home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / terms / kermit / b / ckuker.mss < prev    next >
Encoding:
Text File  |  1992-11-22  |  244.7 KB  |  5,495 lines

  1. @Part(CKUNIX,root="kuser")
  2. @string[-ckversion="5A(180) BETA"]
  3. @define(exx=example,above 2,below 1)
  4. @define(d4=description,leftmargin +4,indent -4,group,blanklines hinge)
  5. @define(d8=description,leftmargin +8,indent -8,group,blanklines hinge)
  6. @define(d128=description,leftmargin +12,indent -8,group,blanklines hinge)
  7. @define(d62=description,leftmargin +6,indent -2,group,blanklines hinge)
  8. @define(d84=description,leftmargin +8,indent -4,group,blanklines hinge)
  9. @Chapter<C-Kermit>
  10. @index<C-Kermit>@index<UNIX Kermit>
  11.  
  12. @case(device,file="********@*
  13. This document is formatted as an ordinary, plain text ASCII disk file.
  14. Typeset copies are available from Columbia
  15. University.  Changes should be made to CKUKER.MSS.@*********")
  16.  
  17. @Begin<Description,spread 0.2>
  18. @i(Program:)@\Frank da Cruz (Columbia University), contributions by many
  19. others.
  20.  
  21. @i(Language:)@\C
  22.  
  23. @i(Documentation:)@\Christine Gianone, Frank da Cruz (Columbia University).
  24.  
  25. @i(Version:)@\@value(-ckversion)
  26.  
  27. @i(Date: )@\May 26, 1992
  28. @end<Description>
  29.  
  30. @subheading<C-Kermit Capabilities At A Glance:>
  31. @begin<format,leftmargin +2,above 1,below 1>
  32. @tabclear()@tabset(3.5inches,4.0inches)
  33. Local operation:@\Yes
  34. Remote operation:@\Yes
  35. Transfer text files:@\Yes
  36. Transfer binary files:@\Yes
  37. International text:@\Yes
  38. Wildcard send:@\Yes
  39. File transfer interruption:@\Yes
  40. Filename collision actions:@\Yes
  41. Can time out:@\Yes
  42. 8th-bit prefixing:@\Yes
  43. Repeat count prefixing:@\Yes
  44. Alternate block checks:@\Yes
  45. Automatic parity detection:@\Yes
  46. Dynamic packet length:@\Yes
  47. CONNECT mode:@\Yes
  48. Terminal emulation:@\Depends on implementation
  49. Key mapping:@\Yes
  50. Communication settings:@\Yes
  51. Transmit BREAK:@\Yes (most versions)
  52. Support for dialout modems:@\Yes
  53. TCP/IP support:@\Yes (some versions, Berkeley sockets)
  54. X.25 support:@\Yes (SUN versions with SunLink)
  55. IBM mainframe communication:@\Yes
  56. Transaction logging:@\Yes
  57. Session logging:@\Yes
  58. Debug logging:@\Yes
  59. Packet logging:@\Yes
  60. Act as server:@\Yes
  61. Talk to server:@\Yes
  62. Advanced server functions:@\Yes
  63. Security for server:@\Yes
  64. Local file management:@\Yes
  65. Command/Init files:@\Yes
  66. Long packets:@\Yes
  67. Sliding Windows:@\Yes
  68. File attributes packets:@\Yes
  69. Command macros:@\Yes
  70. Script programming language:@\Yes
  71. Raw file transmit and capture:@\Yes
  72. @end<format>
  73. @newpage()
  74. @begin<quotation,indent 0>
  75. @bar()
  76.  
  77. @i<IMPORTANT NOTICE:> The user manual for the current release of C-Kermit
  78. is @i"Using C-Kermit", by Frank @w<da Cruz> and Christine M@. Gianone,
  79. published by Digital Press, Burlington, MA.  Publication date: Fall 1992.
  80. After Fall 1992, call Digital Press at 1-800-344-4825 for further information.
  81. @bar()
  82. @end<quotation>
  83.  
  84. @section(Acknowledgements)
  85.  
  86. Thanks to the dozens of people who have been involved in C-Kermit development
  87. over the years, especially Bill Catchings, Jeff Damens and Chris Maio
  88. (formerly of Columbia University), and Herm Fischer of Encino, CA, for their
  89. roles in its initial development.  And special thanks to those who put so much
  90. work into features or testing of version 5A:
  91. @begin(format, above 1, below 1, leftmargin +4)
  92. Kristoffer Eriksson (Peridot Konsult AB, @uoum()rebro, Sweden)
  93. Bo Kullmar (Sveriges Riksbank (Central Bank of Sweden), Stockholm)
  94. Tor Lillqvist (Helsinki University, Finland)
  95. Warren H@. Tucker (Tridom Corporation, Mountain Park, Georgia, USA)
  96. Peter Mauzey (AT&T Bell Laboratories, Middletown, New Jersey, USA)
  97. Terry Kennedy (St Peters College, Jersey City, NJ, USA)
  98. Chuck Hedrick (Rutgers University, New Brunswick, NJ, USA)
  99. Joe R@. Doupnik (Utah State University, USA)
  100. Hirofumi Fujii (Japan National Lab for High Energy Physics, Tokyo)
  101. Ken Yap (University of Rochester, New York, USA)
  102. Marcello Frutig (Catholic University, Rio de Janeiro, Brazil)
  103. Paul Placeway (BBN, Cambridge, Massachusetts, USA)
  104. Mark Buda (Digital Equipment Corporation, New Hampshire, USA)
  105. William Bader (Software Consulting Services, Nazareth, PA, USA)
  106. Steve Walton (California State University Northridge, USA)
  107. Rick Watson (University of Texas at Austin, USA)
  108. Peter Svanberg (Royal Techn. HS, Sweden)
  109. Michel Robitaille (University of Montreal, Canada)
  110. Kai Uwe Rommel (Technische Universit@aum()t Muenchen, Germany)
  111. Paul Kline (Drake University, USA)
  112. Chris Adie (Edinburgh University, Scotland, UK)
  113. Chris Armstrong (Brookhaven National Laboratory, New York, USA)
  114. James Harvey (Indiana/Purdue University, USA)
  115. Bob Larson (University of Southern California, USA)
  116. Christian Hemsing (RWTH Aachen, Germany)
  117. Bruce J@. Moore (Allen-Bradley Co, Highland Heights, OH)
  118. @end(format)
  119.  
  120. Kristoffer, Bo, Warren, and Peter comprised the "modem committee", which
  121. worked long and hard to rationalize C-Kermit's treatment of modem signals in
  122. the many and varied UNIX environments.  Kristoffer and Bo also contributed
  123. much code to the UNIX-specific support modules.  Kristoffer deserves a special
  124. Archaeology Achievement Award for a detailed study and unraveling of many
  125. years' accretions of incomprehensible "magic" in the infamous @q<ckutio.c>
  126. module (a collection of supposedly simple functions that give the emphatic lie
  127. to all claims that UNIX is a "portable operating system").
  128.  
  129. Ken got the TCP/IP support started by supplying the socket-opening code for the
  130. Berkeley UNIX version.  Marcello supplied the SunLink X.25 code.  Paul
  131. Placeway, Rick Watson, Peter Svanberg, Paul Kline, and Michel Robitaille
  132. contributed enormously to the Macintosh version (and continue to do so).
  133. The two Chris's, and more recently Kai-Uwe, for the OS/2 version; Terry,
  134. William, James, Mark for the VAX/VMS version; Steve for the Amiga version;
  135. Christian for the OS-9 version; Bruce for the Atari ST version.
  136.  
  137. Chuck found and fixed many bugs and contributed many valuable insights, as well
  138. as writing the UNIX "man page" for C-Kermit 5A.
  139.  
  140. And thanks to the indefatigable and omniscient Joe Doupnik (author of MS-DOS
  141. Kermit), who worked closely with the authors on the design of the sliding
  142. window algorithms, the script programming language, and the international
  143. character set support during the joint development effort for MS-DOS Kermit
  144. 3.0 and C-Kermit 5A (and in his spare time, Joe lent a hand with the AT&T 7300
  145. UNIX PC version of C-Kermit).  And finally, thanks to the dozens (hundreds) of
  146. others who tested C-Kermit on dozens (hundreds) of hardware and software
  147. platforms and contributed bug reports, fixes, new features, and suggestions:
  148. @begin<format,above 1>
  149.    Chris Adie, Edinburgh U, Scotland (OS/2 support)
  150.    Robert Adsett, University of Waterloo, Canada
  151.    Larry Afrin, Clemson U
  152.    Barry Archer, U of Missouri
  153.    Robert Andersson, International Systems A/S, Oslo, Norway
  154.    Chris Armstrong, Brookhaven National Lab (OS/2)
  155.    William Bader, Moravian College
  156.    Fuat Baran, CUCCA
  157.    Stan Barber, Rice U
  158.    Jim Barbour, U of Colorado
  159.    Donn Baumgartner, Dell
  160.    Nelson Beebe, U of Utah
  161.    Karl Berry, UMB
  162.    Dean W Bettinger, SUNY
  163.    Gary Bilkus
  164.    Marc Boucher, U of Montreal
  165.    Charles Brooks, EDN
  166.    Bob Brown
  167.    Mike Brown, Purdue U
  168.    Jack Bryans, California State U at Long Beach
  169.    Mark Buda, DEC (VAX/VMS)
  170.    Bjorn Carlsson, Stockholm University Computer Centre QZ, Sweden
  171.    Bill Catchings, formerly of CUCCA
  172.    Bob Cattani, Columbia U CS Dept
  173.    Davide Cervone, Rochester University
  174.    Seth Chaiklin, Denmark
  175.    John Chandler, Harvard U / Smithsonian Astronomical Observatory
  176.    John L Chmielewski, AT&T, Lisle, IL
  177.    Howard Chu, U of Michigan
  178.    Bill Coalson, McDonnell Douglas
  179.    Bertie Coopersmith, London, UK
  180.    Chet Creider, University of Western Ontario, Canada
  181.    Alan Crosswell, CUCCA
  182.    Jeff Damens, formerly of CUCCA
  183.    Mark Davies, Bath U, UK
  184.    S. Dezawa, Fujifilm, Japan
  185.    Joe R. Doupnik, Utah State U
  186.    Frank Dreano (Honeywell)
  187.    John Dunlap, University of Washington
  188.    David Dyck, John Fluke Mfg Co.
  189.    Bernie Eiben, DEC
  190.    Kristoffer Eriksson, Peridot Konsult AB, Oerebro, Sweden
  191.    John R. Evans, IRS, Kansas City
  192.    Glenn Everhart, RCA Labs
  193.    Herm Fischer, Encino, CA (extensive contributions to version 4.0)
  194.    Carl Fongheiser, CWRU
  195.    Marcello Frutig, Catholic University, Sao Paulo, Brazil (X.25 support)
  196.    Hirofumi Fujii, Japan Nat'l Lab for High Energy Physics, Tokyo (Kanji)
  197.    Chuck Fuller, PSC
  198.    Andy Fyfe, Caltech
  199.    Christine M. Gianone, CUCCA
  200.    John Gilmore, UC Berkeley
  201.    German Goldszmidt, IBM
  202.    Alistair Gorman, New Zealand
  203.    Chris Green, Essex U, UK
  204.    Alan Grieg, Dundee Tech, Scotland, UK
  205.    Yekta Gursel, MIT
  206.    Jim Guyton, Rand Corp
  207.    Michael Haertel
  208.    Marion Hakanson
  209.    John Hamilston, Iowa State U
  210.    Simon Hania, Netherlands
  211.    Stan Hanks, Rice U.
  212.    Ken Harrenstein, SRI
  213.    James Harvey, Indiana/Purdue U (VMS)
  214.    Rob Healey
  215.    Chuck Hedrick, Rutgers U
  216.    Ron Heiby, Technical Systems Division, Motorola Computer Group
  217.    Steve Hemminger, Tektronix
  218.    Christian Hemsing, RWTH Aachen, Germany (OS-9)
  219.    Andrew Herbert, Monash Univ, Australia
  220.    Mike Hickey, ITI
  221.    R E Hill
  222.    Bill Homer, Cray Research
  223.    Randy Huntziger, National Library of Medicine
  224.    Larry Jacobs, Transarc
  225.    Steve Jenkins, Lancaster University, UK
  226.    Mark B Johnson, Apple Computer
  227.    Eric F Jones, AT&T
  228.    Luke Jones, AT&T
  229.    Peter Jones, U of Quebec Montreal
  230.    Phil Julian, SAS Institute
  231.    Mic Kaczmarczik, U of Texas at Austin
  232.    Sergey Kartashoff, Inst. of Precise Mechanics & Computer Equipment, Moscow
  233.    Howie Kaye, CUCCA
  234.    Rob Kedoin, Linotype Co, Hauppauge, NY (OS/2)
  235.    Mark Kennedy, IBM
  236.    Terry Kennedy, St Peter's College, Jersey City, NJ (VAX/VMS, 2.11 BSD)
  237.    Douglas Kingston, morgan.com
  238.    Tom Kloos, Sequent Computer Systems
  239.    Jim Knutson, U of Texas at Austin
  240.    David Kricker, Encore Computer
  241.    Thomas Krueger, UWM
  242.    Bo Kullmar, Central Bank of Sweden, Kista
  243.    John Kunze, UC Berkeley
  244.    Bob Larson, USC (OS-9)
  245.    Bert Laverman, Groningen U, Netherlands
  246.    Steve Layton
  247.    David Lawyer, UC Irvine
  248.    S.O. Lidie, Lehigh U
  249.    Tor Lillqvist, Helsinki University, Finland
  250.    Dean Long
  251.    Kevin Lowey, U of Saskatchewan (OS/2)
  252.    Andy Lowry, Columbia University
  253.    David MacKenzie, Environmental Defense Fund, University of Maryland
  254.    John Mackin, University of Sidney, Australia
  255.    Martin Maclaren, Bath U, UK
  256.    Chris Maio, Columbia U CS Dept
  257.    Fulvio Marino, Olivetti, Ivrea, Italy
  258.    Peter Mauzey, AT&T
  259.    Tye McQueen, Utah State U
  260.    Ted Medin
  261.    Hellmuth Michaelis
  262.    Leslie Mikesell, American Farm Bureau
  263.    Martin Minow, DEC (VAX/VMS)
  264.    Pawan Mistra, Bellcore
  265.    Ken Mizialko, IBM, Manassas, VA
  266.    Ray Moody, Purdue U
  267.    Bruce J Moore, Allen-Bradley Co, Highland Heights, OH (Atari ST)
  268.    Steve Morley, Convex
  269.    Peter Mossel, Columbia University
  270.    Tony Movshon, NYU
  271.    Lou Muccioli, Swanson Analysis Systems
  272.    Dan Murphy
  273.    Gary Mussar
  274.    John Nall, FSU
  275.    Jack Nelson, University of Pittsburgh
  276.    Jim Noble, Planning Research Corporation (Macintosh)
  277.    Ian O'Brien, Bath U, UK
  278.    John Owens
  279.    Andr@eac() Pirard, University of Liege, Belgium
  280.    Paul Placeway, Ohio State U (Macintosh & more)
  281.    Piet W. Plomp, ICCE, Groningen University, Netherlands
  282.    Ken Poulton, HP Labs
  283.    Manfred Prange, Oakland U
  284.    Frank Prindle, NADC
  285.    Tony Querubin, U of Hawaii
  286.    Anton Rang
  287.    Scott Ribe
  288.    Alan Robiette, Oxford University, UK
  289.    Michel Robitaille, U of Montreal (Mac)
  290.    Kai Uwe Rommel, Technische Universit@aum()t M@uum()nchen (OS/2)
  291.    Larry Rosenman (Amiga)
  292.    Jay Rouman, U of Michigan
  293.    Jack Rouse, SAS Institute (Data General and/or Apollo)
  294.    Stew Rubenstein, Harvard U (VAX/VMS)
  295.    Bill Schilit, Columbia University
  296.    Eric Schnoebelen, Convex
  297.    Benn Schreiber, DEC
  298.    Dan Schullman, DEC (modems, DIAL command, etc)
  299.    John Schultz, 3M
  300.    Steven Schultz, Contel (PDP-11)
  301.    APPP Scorer, Leeds Polytechnic, UK
  302.    Gordon Scott, Micro Focus, Newbury UK
  303.    Gisbert W. Selke, WIdO, Bonn, Germany
  304.    David Sizeland, U of London Medical School
  305.    Fridrik Skulason, Iceland
  306.    Dave Slate
  307.    Bradley Smith, UCLA
  308.    Richard S Smith, Cal State
  309.    Ryan Stanisfer, UNT
  310.    Bertil Stenstroem, Stockholm University Computer Centre (QZ), Sweden
  311.    Peter Svanberg, Royal Techn. HS, Sweden
  312.    Andy Tanenbaum, Vrije U, Amsterdam, Netherlands
  313.    Markku Toijala, Helsinki U of Technology
  314.    Rick Troxel, NIH
  315.    Warren Tucker, Tridom Corp, Mountain Park, GA
  316.    Dave Tweten, AMES-NAS
  317.    G Uddeborg, Sweden
  318.    Walter Underwood, Ford Aerospace
  319.    Pieter Van Der Linden, Centre Mondial, Paris
  320.    Ge van Geldorp, Netherlands
  321.    Fred van Kempen, MINIX User Group, Voorhout, Netherlands
  322.    Wayne Van Pelt, GE/CRD
  323.    Mark Vasoll, Oklahoma State U (V7 UNIX)
  324.    Konstantin Vinogradov, ICSTI, Moscow
  325.    Paul Vixie, DEC
  326.    Dimitri Vulis, CUNY
  327.    Roger Wallace, Raytheon
  328.    Stephen Walton, Calif State U, Northridge (Amiga)
  329.    Jamie Watson, Adasoft, Switzerland (RS/6000)
  330.    Rick Watson, U of Texas (Macintosh)
  331.    Robert Weiner
  332.    Lauren Weinstein
  333.    Joachim Wiesel, U of Karlsruhe, Germany
  334.    Michael Williams, UCLA
  335.    Nate Williams, U of Montana
  336.    David Wilson
  337.    Patrick Wolfe, Kuck & Associates, Inc.
  338.    Gregg Wonderly, Oklahoma State U (V7 UNIX)
  339.    Farrell Woods, Concurrent (formerly Masscomp)
  340.    Dave Woolley, CAP Communication Systems, London
  341.    Jack Woolley, SCT Corp
  342.    Frank Wortner
  343.    Ken Yap, U of Rochester
  344.    John Zeeff, Ann Arbor, MI
  345. @end<format>
  346.  
  347. @section(Introduction)
  348.  
  349. C-Kermit is a communication software program written in C that provides a full
  350. implementation of the Kermit file transfer protocol, plus terminal connection,
  351. modem dialing, file management, and a powerful script programming language.
  352. An important goal of C-Kermit is transportability to different computers and
  353. operating systems.  To date, C-Kermit (one release or another) has been
  354. adapted to UNIX (most versions), VAX/VMS, Data General AOS/VS, IBM OS/2, the
  355. Apple Macintosh, the Commodore Amiga, the Atari ST, Apollo Aegis, OS-9,
  356. NCR 9800/VE, and others.
  357.  
  358. C-Kermit offers you several methods of interaction.  On UNIX, VAX/VMS, and
  359. most other systems, you have access to Kermit's interactive command
  360. parser, and you can also invoke Kermit with command line options.  On
  361. workstations like the Macintosh, there is a mouse-and-window interface with
  362. pull-down menus, radio buttons, and so forth.  In some cases, you have both.
  363.  
  364. Interactive operation gives you full access to all of C-Kermit's features.
  365. Command-line invocation gives you access to a small but useful subset.
  366. Command-line operation is described in Section @ref(-cmdlin).
  367.  
  368. The main part of document concentrates on the general features of C-Kermit.
  369. Sections specific to certain systems -- UNIX, VAX/VMS, OS/2, the Amiga,
  370. OS-9 -- appear at the end.  Material about some of
  371. the implementations remains to be added.  Macintosh Kermit will be
  372. documented in a separate publication.
  373.  
  374. PLEASE NOTE: This manual describes a full-featured version of C-Kermit.
  375. However, some computers do not have address spaces (or C compilers, or
  376. linkers) capable of supporting all Kermit's features, so some features might
  377. be missing from your version.  See the file @q<ckuins.doc> for details.
  378.  
  379. @section(Kermit Software for Other Computers)
  380.  
  381. Kermit software is available from Columbia University for almost every
  382. known computer and operating system, written in a wide variety languages.
  383. For a catalog of Kermit software and ordering information, write to:
  384. @begin<format,leftmargin +2,above 1,below 1>
  385. Kermit Distribution
  386. Columbia University Center for Computing Activities
  387. 612 West 115th Street
  388. New York, NY  10025
  389. USA
  390. @end<format>
  391. or call:
  392. @begin<format,leftmargin +2,above 1,below 1>
  393. (USA) (212) 854-3703
  394. @end<format>
  395.  
  396. MS-DOS Kermit for the IBM PC, PS/2, and compatibles is also available
  397. in bookstores, computer stores, and from the publisher:
  398.  
  399. @begin<text,leftmargin +2,above 1>
  400. Christine M. Gianone, @i"Using MS-DOS Kermit", Second Edition, Digital Press,
  401. Bedford, MA, 1991, 345 pages.  Packaged with MS-DOS Kermit
  402. for the IBM PC, PS/2, and compatibles on a 5.25-inch diskette.
  403.  
  404. @begin<format,leftmargin +4,above 1,below 1>
  405. Order Number: EY-H893E-DP
  406. Digital Press ISBN: 1-55558-082-3
  407. Prentice Hall ISBN: 0-13-952276-X
  408.  
  409. Internation Edition Order Number: EY-H893E-DI
  410. International Prentice Hall ISBN: 0-13-953043-6
  411. @end<format>
  412. US single-copy price: $34.95; quantity discounts available.  Available in
  413. computer bookstores or directly from Digital Press.  In the USA, call
  414. Digital Press toll-free 1-800-344-4825 to order; major credit cards
  415. accepted.  Overseas, order through your bookstore or your local Digital
  416. Equipment Corporation branch.
  417. @end<text>
  418.  
  419. @begin<transparent,need 6>@end<transparent>
  420. A German-language edition is also available:
  421.  
  422. @begin<text,leftmargin +2,above 1,below 1>
  423. Christine M. Gianone, @i"MS-DOS Kermit, Das universelle
  424. Kommunikationsprogramm", Verlag Heinz Heise, Hannover, Germany (1991), 414
  425. pages.  Translated by Gisbert W@. Selke.
  426. Packaged with version 3.11 of MS-DOS Kermit for the IBM PC, PS/2,
  427. and compatibles on a 5.25-inch diskette, including German language help
  428. files.  ISBN 3-88229-006-4
  429. @end<text>
  430.  
  431. @section(Interactive Operation)
  432.  
  433. C-Kermit's interactive command prompt is "@q(C-Kermit>)".  In response to this
  434. prompt, you can type any valid interactive C-Kermit command.  C-Kermit executes
  435. the command and then prompts you for another command.  The process continues
  436. until you instruct the program to terminate.
  437.  
  438. Commands begin with a keyword, normally an English verb, such as "send".  You
  439. may omit trailing characters from any keyword, as long as you specify
  440. sufficient characters to distinguish it from any other keyword valid in that
  441. field.  Certain commonly-@|used keywords (such as "send", "receive", "connect")
  442. also have special non-@|unique abbreviations ("s" for "send", "r" for
  443. "receive", "c" for "connect").
  444.  
  445. Command keywords can be entered in either upper or lower case, or any
  446. combination.  This manual shows command keywords in uppercase for clarity.
  447.  
  448. Certain characters have special functions while you are typing interactive
  449. commands:
  450. @Begin(Description,leftmargin +8,indent -4)
  451. @q(?)@\Question mark, typed at any point in a command, will produce a
  452. message explaining what is possible or expected at that point.  Depending on
  453. the context, the message may be a brief phrase, a menu of keywords, or a list
  454. of files.  Use "?" liberally to feel your way through Kermit's commands.
  455.  
  456. @q(ESC)@\(The Escape or Altmode key) -- Request completion of the current
  457. keyword or filename, or insertion of a default value.  The result will be a
  458. beep if the requested operation fails.
  459.  
  460. @q(TAB)@\(The horizontal Tab key) -- Same as ESC.
  461.  
  462. @q(DEL)@\(The Delete or Rubout key) -- Delete the previous character from the
  463. command.  You may also use BS (Backspace, Control-H) for this function.
  464.  
  465. @q(^W)@\(Control-W) -- Erase the rightmost word from the command line.
  466.  
  467. @q(^U)@\(Control-U) -- Erase the entire command.
  468.  
  469. @q(^R)@\(Control-R) -- Redisplay the current command.
  470.  
  471. @q(^C)@\(Control-C) -- Interrupt a command.
  472.  
  473. @q(SP)@\(Space) -- Delimits fields (keywords, filenames, numbers) within
  474. a command.
  475.  
  476. @q(CR)@\(Carriage Return) -- Enters the command for execution.  LF (Linefeed)
  477. or FF (formfeed) may also be used for this purpose.
  478.  
  479. @q(\)@\(Backslash) -- Enter any of the above characters into the command
  480. literally.  To enter a backslash, type two backslashes in a row (@q[\\]).
  481. A backslash at the end of a command line causes the next line to be treated
  482. as a continuation line; this is useful for readability in command files.
  483. Backslash is also used to introduce special characters, variable names, 
  484. and functions.  These are explained in Section @ref(-bkslash).
  485.  
  486. @q(^Z)@\(Control-Z) -- On systems (like Berkeley UNIX, Ultrix) with job
  487. control, Control-Z is supposed to suspend Kermit, i.e. put it into the
  488. @index<Background> @i<background> in such a way that it can be brought back
  489. into the foreground (e.g. with an '@q<fg>' shell command) with all its
  490. settings intact.
  491. @End(Description)
  492. You may type the editing characters (@q[DEL], @q[^W], etc) repeatedly, to
  493. delete all the way back to the prompt.  No action will be performed until the
  494. command is entered by typing carriage return, linefeed, or formfeed.  If you
  495. make any mistakes, you will receive an informative error message and a new
  496. prompt -- make liberal use of `@q[?]' and ESC to feel your way through the
  497. commands.  One important command is "help" -- you should use it the first time
  498. you run C-Kermit.
  499.  
  500. Comments may be entered as entire commands, or may appear at the end of any
  501. command.  Comments are introduced by semicolon (@q[;]) or pound sign (@q[#]).
  502.  
  503. Interactive C-Kermit accepts commands from files as well as from the keyboard.
  504. When you start C-Kermit, the program looks for a special file, the @i<Kermit
  505. Initialization File> in your home or current directory (first it looks in the
  506. home directory, then in the current one) and executes any commands it finds
  507. there.  These commands must be in interactive format, not command-@|line
  508. format.  The name of the initialization file is @q<.kermrc> in UNIX and OS-9,
  509. and @q<CKERMIT.INI> in most other operating systems.
  510.  
  511. Here is a brief list of C-Kermit interactive commands:
  512. @begin(format,spread 0)
  513. @tabclear()@tabset(1.5inches,2.0inches,2.5inches)
  514. @>@q<;>@\  Introduce a full-line or trailing comment (also @q<#>).
  515. @>@q<!>@\  Execute a system command or enter system command interpreter.
  516. @>@q<@@>@\  Same as @q<!>.
  517. @>ASK@\  Prompt the user, store user's reply in a variable.
  518. @>ASKQ@\  Like ASK, but, but doesn't echo (useful for passwords).
  519. @>ASSIGN@\  Assign an evaluated string to a variable or macro.
  520. @>BUG@\  Instructions for reporting bugs.
  521. @>BYE@\  Terminate and log out a remote Kermit server.
  522. @>CD@\  Change Working Directory (also, CWD).
  523. @>CLEAR@\  Clear communication device input buffer.
  524. @>CLOSE@\  Close a log or other local file.
  525. @>COMMENT@\  Introduce a full-line comment.
  526. @>CONNECT@\  Establish a terminal connection to a remote computer.
  527. @>DECLARE@\  Declare an array.
  528. @>DECREMENT@\  Subtract one (or other number) from a variable.
  529. @>DEFINE@\  Define a variable or macro.
  530. @>DELETE@\  Delete a file or files.
  531. @>DIAL@\  Dial a telephone number.
  532. @>DIRECTORY@\  Display a directory listing.
  533. @>DISABLE@\  Disallow access to selected features during server operation.
  534. @>DO@\  Execute a macro.
  535. @>ECHO@\  Display text on the screen.
  536. @>ELSE@\  ELSE-part of an IF command.
  537. @>ENABLE@\  Allow access to selected features during server operation.
  538. @>END@\  A command file or macro.
  539. @>EXIT@\  Exit from the program, closing all open files and devices.
  540. @>FINISH@\  Instruct a remote Kermit server to exit, but not log out.
  541. @>FOR@\  Execute commands repeatedly in a counted loop.
  542. @>GET@\  Get files from a remote Kermit server.
  543. @>GOTO@\  Go to a labeled command in a command file or macro.
  544. @>HANGUP@\  Hang up the phone or network connection.
  545. @>HELP@\  Display a help message for a given command.
  546. @>IF@\  Conditionally execute the following command.
  547. @>INCREMENT@\  Add one (or other number) to a variable.
  548. @>INPUT@\  Match characters from another computer against a given text.
  549. @>LOG@\  Open a log file -- debugging, packet, session, transaction.
  550. @>MAIL@\  Send a file as electronic mail to a specified address.
  551. @>MSEND@\  Multiple SEND -- send a list of files.
  552. @>OPEN@\  Open a local file for reading or writing.
  553. @>OUTPUT@\  Send text to another computer.
  554. @>PAD@\  (X.25 version only) Give X.25 PAD commands.
  555. @>PAUSE@\  Do nothing for a given number of seconds.
  556. @>PRINT@\  Print a local file on a local printer.
  557. @>PUSH@\  Invoke host system interactive command interpreter.
  558. @>PWD@\  Display current working device/directory.
  559. @>QUIT@\  Same as EXIT.
  560. @>READ@\  Read a line from a local file.
  561. @>RECEIVE@\  Passively wait for files to arrive.
  562. @>REDIAL@\  Redial the most recently dialed phone number.
  563. @>REINPUT@\  Reexamine text previously received from another computer.
  564. @>REMOTE@\  Issue file management commands to a remote Kermit server.
  565. @>RENAME@\  Change the name of a file.
  566. @>RETURN@\  Return from a user-defined function.
  567. @>RUN@\  Run a program or system command.
  568. @>SCRIPT@\  Execute a UUCP-style login script.
  569. @>SEND@\  Send files.
  570. @>SERVER@\  Begin server operation.
  571. @>SET@\  Set various parameters.
  572. @>SHOW@\  Display values of SET parameters.
  573. @>SPACE@\  Display current disk space usage.
  574. @>STATISTICS@\  Display statistics about most recent transaction.
  575. @>STOP@\  Stop executing macro or command file and return to the prompt.
  576. @>SUSPEND@\  Put the Kermit program in the backgound.
  577. @>TAKE@\  Execute commands from a file.
  578. @>TELNET@\  Start a TCP/IP TELNET session.
  579. @>TRANLATE@\  Translate a file's character set.
  580. @>TRANSMIT@\  Upload a file with no error checking.
  581. @>TYPE@\  Display a file on the screen.
  582. @>VERSION@\  Display the program version number on the screen.
  583. @>WAIT@\  Wait for the specified modem signals.
  584. @>WHILE@\  Execute commands repeatedly while a condition is true.
  585. @>WRITE@\  Write text to a local file.
  586. @>XIF@\  Extended IF command.
  587. @end(format)
  588.  
  589. On most computers, C-Kermit can be started simply by typing the word "kermit"
  590. (followed by carriage return).  If no command-line "action options" are
  591. included, Kermit will automatically enter interactive prompting mode.  Let's
  592. begin by looking at a few of C-Kermit's basic interactive commands.  Most
  593. important of all when you are just beginning are the commands to exit from
  594. the program and to get help about it.
  595.  
  596. @subheading(The EXIT and QUIT Commands)
  597.  
  598. Syntax: EXIT [ @i<number> ]
  599. Syntax: QUIT [ @i<number> ]
  600.  
  601. These two commands are identical.  Both of them do the following:
  602.  
  603. @begin(itemize,spread 0)
  604. Hangs up the modem, if the communications line supports data terminal ready.
  605.  
  606. Relinquish access to any communication line assigned via SET LINE, or any
  607. network connection obtained via SET HOST.
  608.  
  609. Relinquish any uucp and multiuser locks on the communications line (UNIX only).
  610.  
  611. Close all open logs or other files.
  612.  
  613. Attempt to insure that your terminal is returned to normal.
  614. @end(itemize)
  615. After exit from C-Kermit, your default directory will be the same as when
  616. you started the program.  The EXIT command is issued implicitly whenever
  617. C-Kermit halts normally, e.g. after a command line invocation, or after certain
  618. kinds of interruptions.
  619.  
  620. C-Kermit returns an exit status of zero, except when an error is
  621. encountered, where the exit status is set to a nonzero number, depending on
  622. the operating system.  In UNIX, the exit status is the sum of 1 (if any SEND
  623. commands failed), 2 (if any RECEIVE or GET commands failed), and 4 (if any
  624. REMOTE commands failed).  If you give a number after the EXIT or QUIT command,
  625. that number is returned instead.
  626.  
  627. @begin(comment) (this is no longer true???)
  628. With background operation (e.g., `@q(&)' at end of invoking command line)
  629. driven by scripted interactive commands (redirected standard input and/or take
  630. files), any failed interactive command (such as failed dial or script attempt)
  631. causes the fatal error exit.
  632. @end(comment)
  633.  
  634. @subheading(The HELP Command)
  635.  
  636. Syntax: HELP [ { @i<command>, { SET, REMOTE } @i<parameter> } ]
  637.  
  638. Brief help messages or menus are always available at interactive command
  639. level by typing a question mark at any point.  A slightly more verbose form
  640. of help is available through the HELP command.  The HELP command with
  641. no arguments prints a brief summary of how to enter commands and how to
  642. get further help.  HELP may be followed by one of the top-level C-Kermit
  643. command keywords, such as SEND, to request information about a command.
  644. Commands such as SET and REMOTE have a further level of help.  Thus you
  645. may type HELP, HELP SET, or HELP SET PARITY; each will provide a
  646. successively more detailed level of help.
  647.  
  648. @subheading(The TAKE Command)
  649.  
  650. Syntax: @q<TAKE >@i<fn1>
  651.  
  652. The TAKE command instructs C-Kermit to execute commands from the named
  653. file.  The file may contain any interactive C-Kermit commands, including
  654. TAKE; command files may be nested to any reasonable depth, but it may
  655. not contain text to be sent to a remote system during the CONNECT command;
  656. Use scripts for that (see sections @ref<-macros> and @ref<-scrcmd>).
  657.  
  658. Echoing of commands from TAKE files and handling of errors during TAKE file
  659. execution are controlled by the SET TAKE command.
  660.  
  661. Comments may be included in take-command files.  Whole-line comments may begin
  662. with the word COMMENT.  Both trailing and whole-line comments can be
  663. introduced using semicolon or pound sign, for example:
  664. @begin(example)
  665. COMMENT - Commands to dial out out using a Hayes modem...
  666. set modem hayes        ; Specify the kind of modem
  667. set line /dev/ttyh8    ; Select a terminal device
  668. set speed 19200        ; Set the speed
  669. dial 7654321           ; Dial the number
  670. @end(example)
  671.  
  672. TAKE-command files are in exactly the same syntax as interactive commands.  If
  673. you want to include special characters like question mark or backslash that
  674. you would have to quote with backslash when typing interactive commands, you
  675. must quote these characters the same way in command files.  Long lines may be
  676. continued by ending them with a single backslash or a dash:
  677. @begin(example)
  678. set\
  679. modem\
  680. hayes
  681. set-
  682. line /dev-
  683. /ttyh8
  684. @end(example)
  685. Continued lines cannot have trailing comments.  If you put a trailing comment
  686. after the dash, then Kermit will not treat the line as continued.  If you put
  687. a dash at the end of a trailing comment, then Kermit will treat the next line
  688. as a continuation of the comment.
  689.  
  690. An implicit TAKE command is executed upon your C-Kermit initialization file
  691. (@q<.kermrc> in UNIX, @q<CKERMIT.INI> elsewhere) when C-Kermit starts up, upon
  692. either interactive or command-line invocation.  The initialization file may
  693. contain SET or other commands you want to be in effect at all times.  For
  694. instance, you might want override the default action when incoming files have
  695. the same names as existing files -- in that case, put a command like:
  696. @example(set file collision overwrite)
  697.  
  698. Under UNIX, you may also use the shell's redirection mechanism to cause
  699. C-Kermit to execute commands from a file:
  700. @example(kermit < cmdfile)
  701. or you can even pipe commands in from another process:
  702. @example(command | kermit)
  703.  
  704. @section(Establishing the Connection)
  705.  
  706. In order to talk about a connection between two computers, we a way to
  707. distinguish between them.  The @i<local> computer is the one that you are
  708. using most directly -- a PC or workstation on your desk, or a timesharing
  709. computer that you are using from a terminal.  Kermit lets you make a
  710. connection from the local computer to a @i<remote> computer, for example by
  711. dialing it up with a modem.  The Kermit program on your local computer is said
  712. to be in "local mode" and the Kermit program on the remote computer is in
  713. "remote mode".
  714.  
  715. C-Kermit can be used in either @i<remote> or @i<local> mode.  If you are using
  716. C-Kermit in remote mode, you can skip ahead to Section @ref(-filxfer), File
  717. Transfer.
  718.  
  719. If you are using C-Kermit in local mode, you must have one of three kinds
  720. of connections to the remote computer:
  721. @begin(enumerate)
  722. A hardwired asynchronous serial connection, either directly to the other
  723. computer, or through some kind of terminal server or switching device.
  724.  
  725. A dialup connection, which you establish by dialing with a modem.
  726.  
  727. A network connection.
  728. @end(enumerate)
  729. To prepare C-Kermit for these connections, several preliminary steps are
  730. necessary using the SET command, which is described in Section
  731. @ref(-setshow), below:
  732. @begin(enumerate)
  733. Direct connection: SET LINE @i<device-name>, SET SPEED @i<bits-per-second>.
  734.  
  735. Dialup connection, which you establish by dialing with a modem: SET MODEM
  736. @i<modem-type>, SET LINE @i<device-name>, SET SPEED @i<bits-per-second>, DIAL
  737. @i<phone-number>.
  738.  
  739. Network connection: SET HOST @i<network-host-name>.  If your version of
  740. C-Kermit supports more than one type of network, give the appropriate SET
  741. NETWORK command before the SET HOST command (the default network type is
  742. TCP/IP).  (Also see the TELNET command, described below.)
  743. @end(enumerate)
  744. In addition, you must establish whatever other communication related settings
  745. are appropriate for the connection, including PARITY, DUPLEX, FLOW, and
  746. HANDSHAKE.  Having done all this, you can use the CONNECT command to
  747. begin a terminal session with the remote computer, and once connected, you can
  748. initiate file transfers.
  749.  
  750. @subheading(The SET LINE Command)
  751.  
  752. Syntax: @q<SET LINE> [ @i<device> ]
  753.  
  754. Close any previously open network, terminal, or modem connection.  If a
  755. device name is given, try to open the device for communication.  If no device
  756. name is given, revert to the default mode of communication (normally remote
  757. mode).
  758.  
  759. @subheading(The SET HOST Command)
  760.  
  761. Syntax: @q<SET HOST> [ @i<host> [ @i<service> ] ]
  762.  
  763. Close any previously open network, terminal, or modem connection.  If the
  764. current network type (see SET NETWORK) is TCP/IP, the @i<host> field can be
  765. specified as an IP host name or a numeric IP host address, followed optionally
  766. by a TCP service name or port number (the default service is TELNET, TCP port
  767. number 23).  If the network type is X.25, the @i<host> field is an X.121
  768. address, and there is no service field.  If no host name is given, revert to
  769. the default mode of communication (normally remote mode).
  770.  
  771. @subheading(The CONNECT Command)
  772.  
  773. The CONNECT command (C is a special abbreviation for CONNECT) links your
  774. terminal to another computer as if it were a local terminal to that computer,
  775. through the device specified in the most recent SET LINE or SET HOST command,
  776. or through the default device if your system is a PC or workstation.  All
  777. characters you type at your keyboard are sent out the communication line (and
  778. if you have SET DUPLEX HALF, also displayed on your screen), and all
  779. characters arriving at the communication port are displayed on the screen.
  780. Current settings of speed, parity, duplex, and flow-@|control are honored, and
  781. the data connection is 7 bits wide unless you have given the command SET
  782. TERMINAL BYTESIZE 8.  If you have issued a LOG SESSION command, everything
  783. you see on your screen will also be recorded to your session log.  This
  784. provides a way to "capture" files from remote systems that don't have Kermit
  785. programs available.
  786.  
  787. To get back to your own system, you must type the "escape character", which is
  788. Control-@|Backslash (@q[^\]) unless you have changed it with the SET ESCAPE
  789. command, followed by a single-@|character command, such as C for "close
  790. connection".  Single-@|character commands may be entered in upper or lower
  791. case.  They include:
  792. @begin(description,leftmargin +8,indent -6,spread 0.4)
  793. @q<C>@\Return to C-Kermit.  If you gave an interactive CONNECT command,
  794. return to the C-Kermit prompt.  If you gave a -c or -n option on the command
  795. line, close the connection and return to the system prompt.
  796.  
  797. @q<B>@\Send a BREAK signal (about 0.275 sec).
  798.  
  799. @q<L>@\Send a Long BREAK signal (about 1.5 sec).
  800.  
  801. @q<0>@\(zero) send a null.
  802.  
  803. @q<S>@\Give a status report about the connection.
  804.  
  805. @q<H>@\Hangup the phone.
  806.  
  807. @q<!>@\Escape to the system command processor "under" Kermit.  Exit or logout
  808. to return to your CONNECT session.
  809.  
  810. @q<Z>@\Suspend Kermit (UNIX only).
  811.  
  812. @q<\nnn>@\A character in backslash-code form.
  813.  
  814. @q[^\]@\Send Control-Backslash itself (whatever you have defined the
  815. escape character to be, typed twice in a row sends one copy of it).
  816. @end(description)
  817. Uppercase and control equivalents for (most of) these letters are also
  818. accepted.  A space typed after the escape character is ignored.  Any other
  819. character will produce a beep.
  820.  
  821. The connect command simply displays incoming characters on the screen.  It is
  822. assumed any screen control sequences sent by the host will be handled by the
  823. firmware or emulation software in your terminal or PC@foot(Several C-Kermit
  824. implementations include terminal emulators, notably Macintosh and OS/2).
  825.  
  826. It is sometimes useful to see exactly what characters the host is
  827. transmitting, rather than having your terminal or emulator interpret them for
  828. you.  If you give the command SET DEBUG SESSION, then during CONNECT, C-Kermit
  829. will display control characters using "uparrow" notation, for example @q<^A>
  830. for Control-A, @q<^B> for Control-B, etc, @q<^[> for ESC.  8-bit characters
  831. are preceded by a tilde (@q<~>) character.
  832.  
  833. @subheading(The DIAL and REDIAL Commands)
  834.  
  835. Syntax: @q(DIAL )@i(telephone-number)@*
  836. Syntax: @q(REDIAL)
  837.  
  838. @index<Modem>@index<Dialout Modem>@index<Autodialer>
  839.  
  840. The DIAL command controls dialout modems; you should have already issued a SET
  841. MODEM command to identify the type of modem to be used for dialing, and then
  842. SET LINE and SET SPEED commands to identify the terminal device to which the
  843. modem is connected, plus any desired SET CARRIER and SET DIAL commands to
  844. modify the behavior of the DIAL command itself.
  845.  
  846. In the DIAL command, you supply the phone number and the
  847. Kermit program feeds it to the modem in the appropriate format and then
  848. interprets dialer return codes and modem signals to inform you whether the
  849. call was completed.  These actions are based upon built-in knowledge of the
  850. control sequences and responses of each make and model of modem that C-Kermit
  851. knows about.
  852.  
  853. The telephone-@|number may contain imbedded modem-@|dialer commands
  854. appropriate to the selected modem type, such as comma for Hayes pause, or
  855. `@q(&)' for Ventel dialtone-@|wait and `@q(%)' for Ventel pause (consult your
  856. modem manual for details).
  857.  
  858. The REDIAL command is exactly like the DIAL command, except it uses the phone
  859. number you specified in your most recent DIAL command.
  860.  
  861. At the time of this writing, support is included for the following modems:
  862. @begin(itemize,spread 0)
  863. AT&T 7300 Internal Modem
  864.  
  865. AT&T 2212C, 2224B, 2224CEO, and 2296A switched network modems in AT&T mode
  866.  
  867. AT&T Digital Terminal Data Module (DTDM)
  868.  
  869. Cermetek Info-Mate 212A
  870.  
  871. Concord Condor CDS 220
  872.  
  873. Courier HST
  874.  
  875. DEC DF03-AC
  876.  
  877. DEC DF100 Series
  878.  
  879. DEC DF200 Series
  880.  
  881. General DataComm 212A/ED
  882.  
  883. Hayes Smartmodem and compatibles
  884.  
  885. IBM/Siemens/Rolm 9751 CBX DCM
  886.  
  887. Microcom AX-9624
  888.  
  889. Penril
  890.  
  891. Racal Vadic
  892.  
  893. Telebit Trailblazer, T1000, T1600, T2500
  894.  
  895. US Robotics 212A
  896.  
  897. Ventel
  898. @end(itemize)
  899. Support for new modems is added to the program from time to time; you
  900. can check the current list by typing SET MODEM ?.
  901.  
  902. There are also two "generic" modem types -- DIRECT (i.e. no modem at all,
  903. so that no attempt is made to deal with modem signals), and UNKNOWN (which
  904. tells C-Kermit to attempt to honor modem signals, but leaves the dialing
  905. mechanism unspecified).  NONE is a synonym for DIRECT.
  906.  
  907. The device used for dialing out is the one selected in the most recent SET
  908. LINE command (or on a workstation, the default line if no SET LINE command
  909. was given).  On UNIX systems, 
  910. the DIAL command attempts to lock the terminal device's
  911. path and to establish a call on an
  912. exclusive basis.  If it is desired to dial a call and then return to the shell
  913. (such as to do Kermit activities depending on standard in/out redirection), it
  914. is necessary to place the dialed call under one device name (say,
  915. "@q</dev/cua0>") and then escape to the shell @i<within Kermit> on a linked
  916. device which is separate from the dialed line (say, "@q</dev/cul0>").  This is
  917. the same technique used by uucp (to allow locks to be placed separately for
  918. dialing and conversing).
  919.  
  920. Because modem dialers have strict requirements to override the carrier-@|detect
  921. signal most UNIX implementations expect, the sequence for dialing is more rigid
  922. than most other C-Kermit procedures.  Example:
  923. @begin(example)
  924. @ux<kermit>
  925. C-Kermit>@ux<set modem hayes>      ; SET MODEM first!
  926. C-Kermit>@ux<set carrier auto>     ; Then SET CARRIER if necessary,
  927. C-Kermit>@ux<set line /dev/acu2>   ; Then SET LINE,
  928. C-Kermit>@ux<set speed 2400>       ; Then SET SPEED,
  929. C-Kermit>@ux<set dial display on>  ; Then SET DIAL if necessary,
  930. C-Kermit>@ux<dial 9,5551212>       ; and finally, DIAL.
  931. Connected!                         ; If DIAL completes OK,
  932. C-Kermit>@ux<connect>              ; you can CONNECT.
  933. @i(logon, do things)
  934. @ux<^\c>
  935. C-Kermit> ...
  936. C-Kermit>@ux<quit>                 ; Disconnect & unlock the line.
  937. @end(example)
  938.  
  939. In general, C-Kermit requires that the modem provide the "carrier detect" (CD)
  940. signal when a call is in progress, and remove that signal when the call
  941. completes or the line drops.  If a modem switch setting is available to force
  942. CD, it should normally not be in that setting.  C-Kermit also requires (on most
  943. systems) that the modem track the computer's "data terminal ready" (DTR)
  944. signal.  If a switch setting is available to simulate DTR asserted within the
  945. modem, then it should normally not be in that setting.  Otherwise the modem
  946. will be unable to hang up at the end of a call or when interrupts are received
  947. by Kermit.
  948.  
  949. If you want to interrupt a DIAL command in progress (for instance, because
  950. you just realize that you gave it the wrong number), type a Control-C
  951. get back to command level.  If you are a UNIX user and your "interrupt
  952. character" is defined as something besides Ctrl-C, use that instead.
  953.  
  954. PROBLEMS: The DIAL command hangs up the phone (see HANGUP) prior to dialing.
  955. Because of the problems described for HANGUP, certain UNIX configurations are
  956. unable to use DIAL when it does this.  To work around this problem, give the
  957. command SET DIAL HANGUP OFF before giving the DIAL command.  If DIAL still
  958. doesn't work right, start over again but this time give the command SET
  959. CARRIER OFF prior to SET LINE.
  960.  
  961. See the command summary for a description of SET DIAL options.  You can use
  962. SET DIAL to modify the modem initialization string, the timeout period for
  963. call completion, and so on.
  964.  
  965. Hayes and Hayes-compatible, as well as Telebit, modem dialing is supported for
  966. both word and digit result codes, and C-Kermit will also attempt to adjust its
  967. communication speed in case these modems complete a call at a lower speed than
  968. it was placed at (if you have a speed-matching modem, you can defeat this
  969. action by giving the command SET DIAL SPEED-MATCHING ON before dialing).
  970.  
  971. @subheading(The HANGUP Command)
  972.  
  973. The HANGUP command attempts to hang up the modem on a local-mode dialout
  974. connection established by SET LINE, or to hang up the network connection
  975. established by SET HOST, in order to break the connection.  On terminal
  976. devices, Kermit accomplishes the hangup by momentarily turning off the Data
  977. Terminal Ready (DTR) RS-232 signal.
  978.  
  979. The means used to drop DTR and bring it back up again are highly dependent on
  980. the computer, the version of UNIX, the communication device, the device
  981. driver, the modem being used, and even the cable that connects the modem to
  982. the communication device.  Therefore you might find that this command fails to
  983. operate as it should.
  984.  
  985. If the HANGUP command fails to hang up a phone connection, then maybe your
  986. modem is configured to ignore DTR.  You should make sure your modem is
  987. configured to pay attention to the computer's DTR signal.  Another possibility
  988. is that your cable is giving the modem a constant DTR signal, looped back from
  989. its own DSR signal; in that case, replace your cable with a regular
  990. straight-through modem cable.
  991.  
  992. If the HANGUP command does indeed hang up the phone connection, but then
  993. you can't communicate with the modem any more to establish a new connection,
  994. your version of UNIX may have dropped the DTR signal without bringing it back
  995. up again properly.  To work around this problem, give the SET LINE command
  996. (with no device name) to close the current device, and then another SET LINE
  997. command specifying the original device to open it again.
  998.  
  999. @subheading(The TELNET Command)
  1000.  
  1001. Syntax: @q(TELNET) [ @i<host> [ @i<service> ] ]
  1002.  
  1003. The TELNET command can be used in C-Kermit implementations that support TCP/IP
  1004. networking.  TELNET is simply a shorthand for SET HOST followed by CONNECT.
  1005. If you give an IP host name (or number), Kermit closes any currently open
  1006. connection and begins a new one to the given host.  If the TCP/IP connection
  1007. is made successfully, Kermit puts itself into CONNECT mode for terminal
  1008. emulation.  If you give a TELNET command without a hostname, the currently
  1009. active TCP/IP session (if any) is resumed; if there is no current session,
  1010. you'll get an error message.  The @i<service> can be a TCP port number or
  1011. service name; the default is 23, the TELNET port.
  1012.  
  1013. @section(File Transfer)
  1014. @label(-filxfer)
  1015.  
  1016. Kermit programs can transfer files correctly and completely, using the Kermit
  1017. file transfer protocol.  A Kermit program must be running on both computers.
  1018. Here is the normal procedure:
  1019. @begin(enumerate)
  1020. Run Kermit on your local computer.
  1021.  
  1022. Make the appropriate communication settings (such as modem type, line, speed,
  1023. parity, etc).
  1024.  
  1025. Establish a connection to the remote computer (DIAL if necessary).
  1026.  
  1027. CONNECT to the remote computer.
  1028.  
  1029. Log in to the remote computer if necessary.
  1030.  
  1031. Start Kermit on the remote computer and tell it to send (or receive) a
  1032. file (or files).
  1033.  
  1034. "Escape back" to the local computer.
  1035.  
  1036. Tell the local computer to receive (or send) a file (or files).
  1037. @end(enumerate)
  1038.  
  1039. When transferring files, C-Kermit converts between upper and lower case
  1040. filenames and between LF and CRLF line terminators automatically, unless told
  1041. to do otherwise.  When binary files must be transferred, the program should be
  1042. instructed not to perform LF/CRLF conversion (@q[-i] on the command line or
  1043. SET FILE TYPE BINARY interactively; see below).
  1044.  
  1045. If C-Kermit is in local mode, the screen is continously updated to
  1046. show the progress of the file transer.  A dot is printed for every four data
  1047. packets, other packets are shown by type:
  1048. @begin(description,leftmargin +6, indent -2, spread 0)
  1049. I@\Exchange Parameter Information
  1050.  
  1051. R@\Receive Initiation
  1052.  
  1053. S@\Send Initiatiation
  1054.  
  1055. A@\Attribute Packet
  1056.  
  1057. F@\File Header
  1058.  
  1059. G@\Generic Server Command
  1060.  
  1061. C@\Remote Host Command
  1062.  
  1063. N@\Negative Acknowledgement (NAK)
  1064.  
  1065. E@\Fatal Error
  1066.  
  1067. T@\Indicates a timeout occurred
  1068.  
  1069. Q@\Indicates a damaged, undesired, or illegal packet was received
  1070.  
  1071. @q<%>@\Indicates a packet was retransmitted
  1072. @end(description)
  1073. You may type the following interruption commands during file transfer:
  1074. @begin(description,leftmargin +6,indent -2,spread 0)
  1075. F@\Interrupt the current File, and go on to the next (if any).
  1076.  
  1077. X@\Interrupt the entire Batch of files, terminate the operation.
  1078.  
  1079. R@\Resend the current packet.
  1080.  
  1081. E@\Error: terminate the current operation immediately and return to prompt.
  1082.  
  1083. A@\Display a status report for the current operation.
  1084. @end(description)
  1085.  
  1086. @i(EMERGENCY EXIT:)@index<Emergency Exit>
  1087. When running C-Kermit in remote mode, if you have started a protocol operation
  1088. (sending or receiving a file, server command wait, etc), you can type two
  1089. Control-C's directly to the UNIX Kermit program ("connect" first if
  1090. necessary):
  1091. @display<Control-C Control-C>
  1092. This will cause the program to display,
  1093. @display<@q[^C^C...]>
  1094. and return you to the C-Kermit prompt.
  1095.  
  1096. Before initiating a file transfer, you should be sure that all communication
  1097. and protocol-related settings are correct.  Version 5A of Kermit attempts to
  1098. make things easier for you in this area in several ways, for example by
  1099. recognizing file attributes (text or binary, character set, etc) from the
  1100. other Kermit if it sends them.  @index<Parity>If your parity is set to NONE,
  1101. C-Kermit automatically recognizes parity bits on received packets, and adjusts
  1102. its parity accordingly.  But it's better to set these C-Kermit parameters
  1103. directly yourself to avoid any confusion that might result from these
  1104. automatic adjustments.
  1105.  
  1106. @subheading<The SEND Command>
  1107.  
  1108. Syntax:  @q<SEND >@i(fn) [ @i<rfn1> ]
  1109.  
  1110. Send the file or files denoted by @i(fn) to the other Kermit, which should be
  1111. running as a server, or which should be given the RECEIVE command.  The
  1112. SEND command may be abbreviated to S, even though S is not a unique
  1113. abbreviation for a top-level C-Kermit command.  Each file is sent under its
  1114. own name (as described above, or as specified by the 'set file names'
  1115. command).  If the second form of the SEND command is used, i.e@. with
  1116. @i(fn1) denoting a single file, @i(rfn1) may be specified as a name to
  1117. send it under.  For example:
  1118. @example[send sows.ear silk.purse]
  1119. sends the file @q[sows.ear] but tells the other Kermit that its name is
  1120. @q[silk.purse].
  1121.  
  1122. @subheading<The MSEND Command>
  1123.  
  1124. Syntax:  @q<MSEND >@i(fn) [ @i<fn> [ @i<fn> [ ... ] ] ]
  1125.  
  1126. The MSEND command also sends one or more files, but unlike the SEND command,
  1127. it allows you to give a list of files to send, and it does @i<not> allow you
  1128. to specify an alternate name.  The MSEND file specifications are separated by
  1129. spaces.
  1130.  
  1131. @index<Wildcard>@index<Metacharacter>
  1132. Both the SEND and MSEND commands allow you to use wildcard (meta) characters
  1133. to specify groups of files.  Exactly which wildcard characters are available
  1134. depend on the host operating system and other factors.  In VAX/VMS, they are
  1135. `@q[*]' and `@q[%]'.  In UNIX they are `@q[~]', `@q[*]', and `@q[?]'.  If
  1136. `@q[?]'  is to be included, it must be prefixed by `@q[\]' to override its
  1137. normal function of providing help.  The `@q[*]' character matches any string,
  1138. and `@q[?]' (UNIX) or `@q[%]' (VMS) matches any single character.
  1139.  
  1140. When @i(fn) contains `@q[*]' or `@q[?]' characters, there is a limit
  1141. to the number of files that can be matched, which varies from system to
  1142. system.  If you get the message "Too many files match" then you'll have to
  1143. make a more judicious selection.  For example, if @i(fn) was of the form:
  1144. @example(usr/longname/anotherlongname/*)
  1145. then C-Kermit's string space will fill up rapidly -- try using CD to change
  1146. your directory to the path in question and reissuing the command.
  1147.  
  1148. Wildcards do not descend through a directory tree.  Only files in the current
  1149. or specified directory are sent.
  1150.  
  1151. In UNIX versions of C-Kermit only, `@q[~]' is treated as a meta character
  1152. if it is the first character in the file specification. If it is followed
  1153. immediately by a slash, a space, or end of line, then your login directory
  1154. name is substituted.  If it is followed immediately by a username, then that
  1155. user's login directory name is substituted.  (In VAX/VMS, you can use logical
  1156. names in the file specification for the same purpose.)
  1157.  
  1158. @b<Wildcard Notation for UNIX>
  1159.  
  1160. Normally, C-Kermit expands wildcard characters itself by searching through the
  1161. disk and matching names against the pattern you specify.  But Kermit's
  1162. pattern-matching abilities are limited to the metacharacters listed above.
  1163. UNIX shells like csh and ksh, on the other hand, offer notations for file
  1164. groups, like `@q([bcdfhjlns]og)' or `@q(*.{txt,doc})' that Kermit cannot
  1165. handle on its own.  Kermit lets you get at these capabilities with the
  1166. command:
  1167.  
  1168. @q<SET WILDCARD-EXPANSION { KERMIT, SHELL }>
  1169.  
  1170. The default is KERMIT, meaning Kermit itself expands wildcards in SEND and
  1171. MSEND, as well as what it receives while in server mode from GET commands.
  1172. The SHELL option means Kermit calls upon the user's preferred shell (via the
  1173. SHELL environment variable, or failing that, the user's login shell via
  1174. getpwuid) to expand them.
  1175.  
  1176. Advantages of the SHELL method include more flexibility in file selection,
  1177. consistency with the user's shell, and ability to handle a larger number of
  1178. files.  But there are drawbacks.  It's noticably slower.  Characters in
  1179. filenames that are special to the shell (like |, &, `, etc) must be quoted
  1180. with \ (this is not necessary when Kermit expands).  And the same Kermit
  1181. command (SEND, MSEND, or GET sent to a server) may behave differently
  1182. depending on what your login shell is.  For example, @qq<{aaa,bbb}> is expanded
  1183. by the csh, but taken literally by sh and ksh; @qq<[a-z]> is expanded by csh
  1184. and ksh, but taken literally by sh.
  1185.  
  1186. The expansion is done by passing "echo " concatenated with your filespec
  1187. to the shell.  This assumes that echo is a built-in shell command, or if it's
  1188. not, then the echo program is in the user's path (risky).  "echo" is used
  1189. rather than "ls -d" because ls says "xxx not found" if xxx does not exist
  1190. (unfortunately, the csh version of "echo" says "echo: no match" if you give it
  1191. a string containing metacharacters and no files match, wherease sh and ksh
  1192. simply echo the string back at you).  It doesn't matter much, because C-Kermit
  1193. checks each word that is returned for its existence as a file (but of course,
  1194. you could have a file called "echo:", "no", or "match"...).  And then what
  1195. happens if your have a file called "@q<-n>"?  ("@q<echo> @q<-n>" is a command.
  1196. Refer to a file called "@q<-n>" in the current directory as "@q<./-n>").
  1197.  
  1198. @b<Text vs Binary Files>
  1199.  
  1200. @index<Binary Files>@index<Attributes>
  1201. When C-Kermit sends each file, it also sends certain information about the
  1202. file in an "attribute packet", provided the other Kermit agrees to accept
  1203. attribute packets.  This information includes the size, type (text
  1204. or binary, determined from the "-i" command-line option or the "set file type"
  1205. command), creation date, and a code to let the other Kermit know that the file
  1206. is being sent from a UNIX system.  The other Kermit may accept or refuse the
  1207. file based upon these attributes, for example, if it doesn't have enough disk
  1208. space to store a file of the specified size.
  1209.  
  1210. The file type attribute allows C-Kermit, when sending a file, to tell the
  1211. receiving whether it should be in text or binary mode.  Therefore, if the
  1212. receiving Kermit has this feature, it is not necessay to give it a SET FILE
  1213. TYPE command to "match modes" with C-Kermit.
  1214.  
  1215. @i<Note> -- C-Kermit sends only from the current or specified directory.  It
  1216. does not traverse directory trees.  If the source directory contains
  1217. subdirectories, they will be skipped.  By the same token, C-Kermit does not
  1218. create directories when receiving files.  If you have a need to do this, you
  1219. can pipe tar through C-Kermit, as shown in the example in section
  1220. @ref(-cmdlin), or under AT&T System III/V UNIX you can use cpio, or BACKUP
  1221. under VAX/VMS, etc.
  1222.  
  1223. @i<Another Note> -- The SEND command skips over "invisible" files
  1224. that match the file specification; UNIX systems usually treat files whose names
  1225. start with a dot (like @q(.login), @q(.cshrc), and @q(.kermrc)) as invisible.
  1226. If you want to send these, include the dot in your filespec, as in:
  1227. @example(send .*)
  1228.  
  1229. @subheading<The RECEIVE Command>
  1230.  
  1231. Syntax:  @q<RECEIVE> [@i<fn1>]
  1232.  
  1233. Passively wait for files to arrive from the other Kermit, which must be given
  1234. the SEND command -- the RECEIVE command does not work in conjunction with a
  1235. server (use GET for that).  If @i(fn1) is specified, store the first incoming
  1236. file under that name.  The RECEIVE command may be abbreviated to R.
  1237.  
  1238. @index(Binary Files)@index<Attributes>
  1239. Incoming file data is normally decoded and stored according to whether
  1240. C-Kermit is in text or binary mode.  But if the other Kermit sends the
  1241. file-type attribute, this will override C-Kermit's file-type setting on a
  1242. per-file basis.  Therefore, it is possible for another Kermit program to send
  1243. C-Kermit a mixture of text and binary files, so long as the type of each file
  1244. is indicated in the Attribute packet.  For text files, C-Kermit will perform
  1245. character-set translation if a known transfer character set is indicated in the
  1246. Attribute packet (see section on International Characters).
  1247.  
  1248. C-Kermit also attempts to store the incoming file with the creation date
  1249. that is specified in the Attribute packet.  C-Kermit does not attempt to
  1250. verify disk space against the announced size of the incoming file.
  1251.  
  1252. You can control C-Kermit's use of these attributes using the SET ATTRIBUTE
  1253. command.
  1254.  
  1255. @subheading(The STATISTICS Command)
  1256.  
  1257. The STATISTICS command displays information about the most recent Kermit file
  1258. transfer or other protocol transaction, including file and communication line
  1259. input and output, timing and efficiency, as well as what encoding options were
  1260. in effect (such as 8th-bit prefixing, repeat-@|count compression, packet
  1261. lengths, window size).
  1262.  
  1263. @subheading(Non-Protocol Data Transfers)
  1264.  
  1265. It is also possible to transfer files with other computers that do not have a
  1266. Kermit program available.  To send a file to such a computer, use the TRANSMIT
  1267. command:
  1268.  
  1269. Syntax: @q<TRANSMIT> @i<fn1>
  1270.  
  1271. This command sends the named file without error checking, obeying current
  1272. settings for file type (text or binary), parity, and duplex.
  1273.  
  1274. In text mode, send the file a line at a time, with character translations done
  1275. according to the current file and transfer character sets, using the SET
  1276. TRANSMIT PROMPT character (linefeed, @q<\10>, by default) as a line turnaround
  1277. character.  That is, send a line from the file, wait until the prompt
  1278. character comes in response, then send the next line, and so on.  If zero (0)
  1279. is specified for the prompt character, then send the whole file without
  1280. waiting for any response or echo from the host.  Don't try this unless you
  1281. know that the host can successfully process long continuous bursts of input
  1282. characters.  Each line is terminated by a carriage return, just as you would
  1283. type it at a terminal.  Linefeeds are stripped unless you have given the
  1284. command SET TRANSMIT LINEFEED ON.  The computer to which you are transmitting
  1285. the file should be prepared to receive it, for instance into a text editor.
  1286.  
  1287. In binary mode, send all the characters of the file with no modification and
  1288. no line turnaround handshake (the TRANSMIT PROMPT setting is ignored).
  1289. Use binary mode only if you know that the
  1290. computer or device to which you are transmitting the file can receive
  1291. arbitrary patterns of characters at full speed.
  1292.  
  1293. If you want to transmit 8-bit data over a 7-bit connection (i.e. PARITY is not
  1294. NONE), you can use SET TRANSMIT LOCKING-SHIFT ON to have Kermit send SO/SI
  1295. shifts around your 8-bit characters.  The TRANSMIT command can be interrupted
  1296. by typing Ctrl-C.  Also see SET TRANSMIT.
  1297.  
  1298. The opposite of TRANSMIT is LOG SESSION, which lets you capture files or
  1299. screen data from remote computers during CONNECT, also without error checking.
  1300.  
  1301. XMIT may be used as a synonym for TRANSMIT in the TRANSMIT, SET TRANSMIT, and
  1302. SHOW TRANSMIT commands.
  1303.  
  1304. @section(Being and Using a Kermit Server)
  1305. @label(-server)
  1306.  
  1307. The SERVER command places C-Kermit in "server mode" on the currently selected
  1308. communication device or network connection.  All further commands must arrive
  1309. as valid Kermit packets from the Kermit on the other end of the line.  If you
  1310. are running C-Kermit on the remote computer, then you should escape back to
  1311. your local computer after you give C-Kermit the SERVER command, and then issue
  1312. all further commands to the C-Kermit server from your local Kermit's command
  1313. prompt.  It is also possible to work the other way: your local computer is the
  1314. Kermit server and the remote computer issues the commands -- this can only
  1315. work if the remote Kermit is driven by a TAKE command file (which should end
  1316. with the command FINISH).
  1317.  
  1318. The C-Kermit server can respond to the following commands from the client:
  1319. @begin(format,spread 0,above 1,below 1,leftmargin +2)
  1320. @tabclear()@tabset(2.25inches)
  1321. @ux<Client Command>@\@ux<Server Response>
  1322.   GET@\  Sends files
  1323.   SEND@\  Receives files
  1324.   MAIL@\  Sends incoming files as e-mail to specified address
  1325.   BYE@\  Attempts to log itself out
  1326.   FINISH@\  Exits to level from which it was invoked
  1327.   REMOTE CD@\  Changes working directory (also, remote cd)
  1328.   REMOTE DIRECTORY@\  Sends directory listing
  1329.   REMOTE DELETE@\  Removes files
  1330.   REMOTE HELP@\  Lists these capabilities
  1331.   REMOTE HOST@\  Executes a UNIX shell command
  1332.   REMOTE KERMIT@\  Sends a Kermit command to a Kermit server
  1333.   REMOTE LOGIN@\  Login to a Kermit server that requires this
  1334.   REMOTE LOGOUT@\  Logout from a Kermit server
  1335.   REMOTE PRINT@\  Receives a file and prints it
  1336.   REMOTE SET@\  Changes its settings
  1337.   REMOTE SPACE@\  Reports about its disk usage
  1338.   REMOTE TYPE@\  Sends files to your screen
  1339.   REMOTE WHO@\  Shows who's logged in
  1340. @end(format)
  1341.  
  1342. If the Kermit server is directed at an external line (i.e. it is in "local
  1343. mode") then the console may be used for other work if you SET FILE DISPLAY OFF
  1344. and run it in the background; normally the program expects the console to be
  1345. used to observe file transfers and enter status queries or to interrupt
  1346. commands.  The way to get C-Kermit into background@index<Background> operation
  1347. from interactive command level varies from system to system (e.g. on Berkeley
  1348. UNIX you would halt the program with @q(^Z) and then use the C-Shell 'bg'
  1349. command to continue it in the background).  The more common method is to
  1350. invoke the program with the desired command line arguments, including
  1351. "@q(-q)", and with a terminating "@q(&)".
  1352.  
  1353. The C-Kermit server will accept a list of files in GET commands sent by
  1354. the client, similar to the list you can give to the MSEND command, e.g.:
  1355. @begin<example>
  1356. MS-Kermit>@ux[get ~joe/new.txt /etc/termcap ../*.c]
  1357. @end<example>
  1358. The file specifications are separated by spaces.  If you need to include a
  1359. space in a filename, quote it with a backslash, for example:
  1360. @begin<example>
  1361. MS-Kermit>@ux<get node"user\ passwd"::dev:[dir]name.ext>
  1362. @end<example>
  1363. If you need to include a backslash, use two of them.
  1364.  
  1365. When the UNIX Kermit server is given a REMOTE HOST command, it executes it
  1366. using the shell invoked upon login, e.g. the Bourne shell, the Korn Shell, or
  1367. the Berkeley C-Shell (or whatever the user has set her SHELL environment
  1368. variable to be).
  1369.  
  1370. The server can issue periodic NAK packets.  You can control the rate at which
  1371. this happens via SET SERVER TIMEOUT.  Specifiying a value of zero instructs
  1372. C-Kermit not to do this at all.  A nonzero value, n, makes a NAK appear every
  1373. n seconds during server command wait.  This is useful if the client Kermit is
  1374. not capable of timeouts, and a packet that it sends to the server is lost.
  1375. The default server timeout is zero.
  1376.  
  1377. SECURITY.  Before putting C-Kermit into server mode, you can give it commands
  1378. to restrict the types of access it allows to clients.  The command is DISABLE.
  1379. You can turn these accesses back on using the ENABLE command.  Here are the
  1380. items that can be controlled in this way, with the effect of DISABLE noted.
  1381. CAUTION: If you leave HOST enabled, the client can get around some of these
  1382. restrictions with REMOTE HOST commands.
  1383. @begin(description,spread 0)
  1384. BYE@\Ignore BYE commands from the client, stay in server mode.
  1385.  
  1386. CD@\Don't let the client change directories, or send files to, or get files
  1387. from, or delete or type files in, any but the current directory, nor inquire
  1388. about space in any but the current directory.
  1389.  
  1390. DELETE@\Don't let the client delete any files.
  1391.  
  1392. DIRECTORY@\Don't let the client request a directory listing.
  1393.  
  1394. FINISH@\Ignore FINISH commands from the client, stay in server mode.
  1395.  
  1396. GET@\Don't let the client GET files.
  1397.  
  1398. HOST@\Ignore REMOTE HOST commands from the client.
  1399.  
  1400. SEND@\Don't accept files that the client tries to send.
  1401.  
  1402. SET@\Refuse REMOTE SET commands from the client.
  1403.  
  1404. SPACE@\Refuse REMOTE SPACE commands from the client.
  1405.  
  1406. TYPE@\Refuse REMOTE TYPE commands from the client.
  1407.  
  1408. WHO@\Refuse REMOTE WHO commands from the client.
  1409.  
  1410. ALL@\All of the above.
  1411. @end(description)
  1412.  
  1413. @subheading(Using a Kermit Server)
  1414.  
  1415. C-Kermit may itself request services from a remote Kermit server.
  1416. To send a file to a Kermit server, use the SEND command, just as you would to
  1417. send a file to a Kermit program that has been given the RECEIVE command.  But
  1418. you cannot use the RECEIVE command to get a file from a Kermit server, because
  1419. the RECEIVE command just waits passively for a file to arrive, but the server
  1420. has not been told which file to send.  For this, you need the GET command:
  1421.  
  1422. Syntax:@q<  GET >@i<rfn>
  1423. @begin(example)
  1424.     @i<or>: GET
  1425.             @i(rfn)
  1426.             @i(fn1)
  1427. @end(example)
  1428.  
  1429. The GET command requests a remote Kermit server to send the named file or
  1430. files, it must be used in place of RECEIVE.
  1431. Since a remote file specification (or list) might contain spaces,
  1432. which normally delimit fields of a C-Kermit command, an alternate form of the
  1433. command is provided to allow the inbound file to be given a new name: type GET
  1434. alone on a line, and you will be prompted separately for the remote and local
  1435. file specifications, for example:
  1436. @Begin(Example)
  1437. C-Kermit>@ux(get)
  1438.  Remote file specification: @ux(profile exec)
  1439.  Local name to store it under: @ux(profile.exec)
  1440. @End(Example)
  1441. If a `@q[?]' is to be included in the remote file specification, you must
  1442. prefix it with `@q[\]' to suppress its normal function of providing help.
  1443.  
  1444. If you have started a multiline GET command, you may escape from its
  1445. lower-@|level prompts by typing a carriage return in response to the prompt,
  1446. e.g.
  1447. @Begin(Example)
  1448. C-Kermit>@ux(get)
  1449.  Remote file specification: @ux(foo)
  1450.  Local name to store it under: @i<(Type a carriage return here)>
  1451. (cancelled)
  1452. C-Kermit>
  1453. @End(Example)
  1454.  
  1455. After the GET command has been entered, the file transfer proceeds exactly
  1456. as if you had given a SEND command to the other Kermit and a RECEIVE
  1457. command to this one.
  1458.  
  1459. In addition to SEND and GET, the following commands may also be sent from
  1460. C-Kermit to a Kermit server.  If the server does not support a command that
  1461. you send to it, it will respond with a message like "Unknown server command"
  1462. or "Unimplemented REMOTE command".
  1463. @begin(d84)
  1464. REMOTE CD [@i(directory)]@\Request the server to change its default directory
  1465. (and/or device) to the one you specify.  If none is specified, the server
  1466. is requested to return to its primary default directory (normally the login
  1467. directory).
  1468.  
  1469. REMOTE DELETE @i<rfn>@\The server is requested to delete the specified file or
  1470. files.
  1471.  
  1472. REMOTE DIRECTORY [@i(rfn)]@\The server is requested to send a directory
  1473. listing of the specifed files.  If no files are specified, then the server
  1474. should send a listing of all the files in the current directory.
  1475.  
  1476. REMOTE HELP@\The server is requested to send to your screen a list of the
  1477. commands that you may issue to it from your local Kermit.
  1478.  
  1479. REMOTE HOST @i(command)@\The server is requested to ask its host operating
  1480. system to execute the given command.
  1481.  
  1482. REMOTE KERMIT @i(command)@\The remote server is requested to execute the given
  1483. command, which is in its own (Kermit program) syntax.
  1484.  
  1485. REMOTE LOGIN @i(userid) @i(password) [@i(account)]@\If a remote Kermit server
  1486. has been set up to require to provide a user ID and password before you can
  1487. gain access to it, use this command to send it the user ID and password.
  1488.  
  1489. REMOTE LOGOUT@\Remove your access from a remote Kermit server that you have
  1490. REMOTE LOGIN'ed to.
  1491.  
  1492. REMOTE PRINT @i(file) [@i(options)]@\The file is sent to the server, which is
  1493. requested via Attribute packet to print it on its printer using the specified
  1494. print options.
  1495.  
  1496. REMOTE SET @i<parameter> @i<value>@\The server is requested to set the given
  1497. parameter to the specified value.  Use question mark to find out what
  1498. parameters and values are available.  The meanings of these parameters and
  1499. values are explained in the section on the SET command, below.  Perhaps the
  1500. most useful one is REMOTE SET FILE TYPE { TEXT, BINARY }.
  1501.  
  1502. REMOTE SPACE [@i(dir)]@\The server is requested to report on available disk
  1503. space in the specified device and/or directory, or in the current area if none
  1504. specified.
  1505.  
  1506. REMOTE TYPE [@i(rfn)]@\The server is requested to send the specified file for
  1507. display on your screen.
  1508.  
  1509. REMOTE WHO [@i(user)]@\The server is requested to send a list of the users who
  1510. are logged in on its computer.  If a username is given, information about that
  1511. user is requested.
  1512.  
  1513. BYE @i(and) FINISH:@\When connected to a remote Kermit server, these commands
  1514. cause the remote server to terminate; FINISH returns it to Kermit or system
  1515. command level (depending on the implementation or how the program was invoked);
  1516. BYE also requests it to log itself out.
  1517. @end(d84)
  1518.  
  1519. @section(International Character Sets)
  1520.  
  1521. Text files may be written in languages other than English, and in most cases
  1522. that means that they contain non-ASCII characters such as accented letters,
  1523. special punctuation marks, etc.  Many different character sets have been
  1524. devised to represent different languages.  These character sets are sometimes
  1525. specific to a particular computer manufacturer, and sometimes they conform to
  1526. one standard or another.  The Kermit file transfer protocol permits Kermit
  1527. programs to exchange files written in different character sets by translating
  1528. between each computer's local file character set and a standard set that is
  1529. used "on the wire".  Here are the relevant commands:
  1530. @begin(d84)
  1531. SET FILE TYPE TEXT@\Character set translation is not done at all unless the
  1532. file type is text.
  1533.  
  1534. SET TRANSFER CHARACTER-SET @i<name>@\Tell C-Kermit which character set is to
  1535. be used on the wire, i.e. within the Kermit packets.  The choices are
  1536. TRANSPARENT (no translation, this is the default), ASCII (translate to/from US
  1537. ASCII), LATIN1 (ISO 8859-1 Latin Alphabet 1), CYRILLIC-ISO (ISO 8859-5
  1538. Latin/Cyrillic Alphabet), and JAPANESE-EUC.  Synonym: SET XFER CHARACTER-SET.
  1539.  
  1540. SET FILE CHARACTER-SET @i<name>@\Tell C-Kermit which character set is used in
  1541. the local file, ASCII, or any of a dozen or so 7-bit national replacement
  1542. character sets (NRCs) such as ITALIAN, NORWEGIAN, etc, or an 8-bit character
  1543. set like LATIN1, DEC-Multinational, DG-International, NEXT (for NeXT
  1544. workstations), CP437 or CP850 (for IBM or Xenix systems), APPLE (for A/UX on
  1545. the Macintosh); CP866, KOI8-CYRILLIC, CYRILLIC-ISO, and SHORT-KOI for Cyrillic;
  1546. and JAPANESE-EUC, DEC-KANJI, SHIFT-JIS, and JIS7 for Japanese Kanji.
  1547.  
  1548. SET LANGUAGE @i<name>@\Enable certain language-specific translations,
  1549. especially for DUTCH, ICELANDIC, GERMAN, RUSSIAN, and the Scandinavian
  1550. languages.  In particular, SET LANGUAGE RUSSIAN makes Kermit treat ASCII
  1551. as if it were SHORT-KOI when it is a FILE or TRANSFER character set, and
  1552. the corresponding TRANSFER or FILE character set is an 8-bit Cyrillic set.
  1553.  
  1554. TRANSLATE @i<file1> @i<cs1> @i<cs2> [ @i<file2> ]@\Translate the local file
  1555. @i<file1> from the character set @i<cs1> into the character set @i<cs2>.  Both
  1556. character sets may be selected from C-Kermit's repertoire of file character
  1557. sets.  The result is stored in @i<file2> or (if @i<file2> is not specified),
  1558. displayed on the screen.  If LANGUAGE is set to RUSSIAN, ISO Latin-Cyrillic is
  1559. used as the intermediate standard character set during translation, otherwise
  1560. ISO Latin Alphabet 1 is used.  Does not yet work for Kanji.
  1561. @end(d84)
  1562. The SET commands are described in more detail later.
  1563.  
  1564. When sending a file, C-Kermit translates the file from the specified file
  1565. character set into the specified transfer character set, and an identifier for
  1566. the selected transfer character set is included in the file attribute packet,
  1567. if use of attribute packets has been negotiated and a SET ATTR [CHARACTER-SET]
  1568. OFF command has not been given.
  1569.  
  1570. When receiving, C-Kermit translates from the specified transfer character set
  1571. to the specified file character set or, if a transfer character set is
  1572. identified in the incoming attribute packet it is used instead.  If the file
  1573. character set is ASCII and special characters are being received, then they
  1574. are translated by stripping diacritical marks and aiming for the closest
  1575. possible 1-to-1 translation on a per-character basis.  But if a SET LANGUAGE
  1576. command has been given, special translations can be done.  For example if
  1577. LANGUAGE has been set to GERMAN and the local file character set is ASCII, and
  1578. a file arrives with a transfer character set of LATIN1, then C-Kermit will
  1579. translate German umlaut-vowels into the corresponding vowels followed by the
  1580. letter e, and German double-s into two s's.  Similar translations take effect
  1581. for other languages.
  1582.  
  1583. If unwanted effects appear because of Kermit's translation, you can disable
  1584. this feature with SET ATTRIBUTE CHARACTER-SET OFF.
  1585.  
  1586. When transferring text that contains long runs of 8-bit data over a 7-bit
  1587. communication channel, efficiency can be improved with the following command:
  1588. @begin(d84)
  1589. SET TRANSFER LOCKING-SHIFT { OFF, ON, FORCED }@\Specifies whether locking
  1590. shifts should be used by Kermit when encoding and decoding packets.  A locking
  1591. shift is a special character, Ctrl-N (Shift-Out, SO), that means that all
  1592. the following characters, up to the next Ctrl-O (Shift-In, SI), are to have
  1593. their 8th bits set to 1 upon receipt.  For long runs of 8-bit characters, this
  1594. is more efficient than Kermit's regular "single shift" method of prefixing
  1595. each 8-bit character by an @q<&>-sign.  Synonym: SET XFER LOCKING-SHIFT.
  1596. The options are:
  1597. @begin<d4>
  1598. ON@\This is the default setting.  If PARITY is not NONE, try to negotiate the
  1599. use of locking shift protocol with the other Kermit, and use it if the other
  1600. Kermit agrees.  If PARITY is NONE, locking shifts won't be used.
  1601.  
  1602. OFF@\Don't use locking shifts.
  1603.  
  1604. FORCED@\Use locking shifts, regardless of the parity setting and negotiations.
  1605. Automatically disables the use of 8th-bit prefixing (single shifts).  For the
  1606. file sender, this command lets data be sent to the receiver with embedded SO
  1607. and SI characters, which can be processed properly by many terminals,
  1608. printers, and other devices.  For the file receiver, this command forces the
  1609. treatment of SO and SI characters in the data as shift commands.
  1610. @end<d4>
  1611. @end(d84)
  1612. Locking shifts are most effective for text written in non-Roman alphabets
  1613. and encoded in standard 8-bit character sets like ISO Latin/Cyrillic,
  1614. ISO Latin/Arabic, ISO Latin/Hebrew, ISO Latin/Greek, or Japanese EUC.
  1615. Locking-shift status is displayed by the SHOW and STATISTICS commands.
  1616.  
  1617. @section(Logging Things)
  1618.  
  1619. Kermit's actions during terminal connection and file transfer can be
  1620. logged in several ways, using the LOG command:
  1621.  
  1622. Syntax: @q<LOG {DEBUGGING, PACKETS, SESSION, TRANSACTIONS} >@~
  1623. [ @i(fn1) [ { APPEND, NEW }=NEW ] ]
  1624.  
  1625. C-Kermit's progress may be logged in various ways.  The LOG command
  1626. opens a log, the CLOSE command closes it.  In addition, all open logs
  1627. are closed by the EXIT and QUIT commands.  A name may be specified for
  1628. a log file; if the name is omitted, the file is created with a default
  1629. name as shown below.  If the keyword APPEND is included at the end of
  1630. the command, then if the specified file exists, it is appended to rather than
  1631. written over; if it does not exist, a new file is created.
  1632.  
  1633. @begin(d4)
  1634. LOG DEBUGGING@\This produces a voluminous log of the internal workings of
  1635. C-Kermit, of use to Kermit developers or maintainers in tracking down suspected
  1636. bugs in the C-Kermit program.  Use of this feature slows down the
  1637. Kermit protocol and fills up your disk.  Default name: @q(debug.log).
  1638.  
  1639. LOG PACKETS@\This produces a record of all the packets that go in and out of
  1640. the communication port.  This log is of use to Kermit maintainers who are
  1641. tracking down protocol problems in either C-Kermit or any Kermit that
  1642. C-Kermit is connected to.  Default name:  @q(packet.log).
  1643.  
  1644. LOG SESSION@\This log will contain a copy of everything you see on your screen
  1645. during the CONNECT command, except for local messages or interaction with
  1646. local escape commands.  Default name:  @q(session.log).
  1647.  
  1648. LOG TRANSACTIONS@\The transaction log is a record of all the files that were
  1649. sent or received while transaction logging was in effect.  It includes time
  1650. stamps and statistics, filename transformations, and records of any
  1651. errors that may have occurred.  The transaction log allows you to have
  1652. long unattended file transfer sessions without fear of missing some
  1653. vital screen message.  Default name:  @q(transact.log).
  1654. @end(d4)
  1655. The CLOSE command closes the named log, e.g. CLOSE DEBUG, CLOSE SESSION.
  1656.  
  1657. @i<Note:>  Debug and Transaction logs are a compile-time option; C-Kermit may
  1658. be compiled without these logs, in which case it will run faster, it will
  1659. take up less space on the disk, but the commands relating to them will not
  1660. be present.
  1661.  
  1662. @section(Local File Management)
  1663.  
  1664. C-Kermit allows the following local file management functions from its
  1665. interactive command level:
  1666. @begin(description,leftmargin +4,indent -4)
  1667. CD [@i<directory-name>]@\
  1668. Changes Kermit's working device and/or directory to the one given, or to the
  1669. user's default directory and/or device if the name is omitted.  This command
  1670. affects only the Kermit process and any processes it may subsequently create.
  1671. You may use CWD and SET DEFAULT as synonyms for CD.
  1672.  
  1673. DELETE @i<fn>@\Deletes (removes, erases) file @i<fn>, which may be the name of
  1674. a single file or a wildcard specification containing @q<*> and/or @q<?>
  1675. characters.  You may use RM as a synonym for DELETE.
  1676.  
  1677. DIRECTORY [@i(fn)]@\Displays a listing of the files whose names match @i(fn),
  1678. which may be the name of a single file or a wildcard specification containing
  1679. @q<*> and/or @q<?> characters.  If no @i<fn> is given, C-Kermit lists all
  1680. files in the current device and/or directory.  The format of and information
  1681. provided in the listing depends on the operating system.  You may use LS as a
  1682. synonym for DIRECTORY.
  1683.  
  1684. PWD@\(Print Working Directory) Display the current working (default) file
  1685. device and/or directory.  You may use SHOW DEFAULT as a synonym for PWD.
  1686.  
  1687. PRINT @i<fn1> [ @i<options> ]@\Print the local file @i<fn1> on a local
  1688. printer.  Options can be included after the filename, for example, to select
  1689. a particular printer.  The options are in the format of the local system's
  1690. printing command.
  1691.  
  1692. RENAME @i<fn1> @i<fn2>@\Changes the name of file @i<fn1> to @i<fn2>.  You may
  1693. use MV as a synonym for RENAME.
  1694.  
  1695. SPACE@\Displays information about disk space and/or quota in the current
  1696. directory and device.
  1697.  
  1698. TYPE @i<fn>@\Display the named file on the screen.  May be interrupted with
  1699. Ctrl-C, and on most systems the display can be stopped and resumed with
  1700. Ctrl-S and Ctrl-Q, respectively.  You may use CAT as a synonym for TYPE.
  1701.  
  1702. { @q(@@), @q(!), RUN, PUSH }@\@begin(multiple)
  1703. The @i<command> is executed by your computer's operating system command
  1704. interpreter (UNIX shell, VMS DCL, etc).  If no command is specified, then an
  1705. interactive session is started; exiting from this session, e.g. by typing
  1706. Control-D or 'exit' to a UNIX shell, or LOGOUT to VMS DCL, will return you to
  1707. C-Kermit command level.  Use the `@q(!)' command to provide file management or
  1708. other functions not explicitly provided by C-Kermit commands.  @q<!>, @q<@@>,
  1709. RUN, and PUSH are all synonyms for the same command.
  1710.  
  1711. @comment{
  1712. If you include the "@q(>)" character before the command, then the command's
  1713. output will not be displayed on your screen, but rather it will be sent out
  1714. the communication device selected in the most recent SET LINE or SET HOST
  1715. command.
  1716. }
  1717. @end(multiple)
  1718. @end(description)
  1719.  
  1720. @section(The SET and SHOW Commands)
  1721. @label(-setshow)
  1722.  
  1723. Since Kermit is designed to allow diverse computers to communicate, it is
  1724. often necessary to issue special instructions to allow Kermit to adapt
  1725. to peculiarities of the other computer or the communication path.  These
  1726. instructions are accomplished by the SET command.  The following parameters
  1727. may be SET:
  1728. @begin(format,spread 0)
  1729. @tabclear()@tabset(1.5inches,2.0inches,2.5inches)
  1730. @>ATTRIBUTES@\  Turn Attribute packet processing on or off.
  1731. @>BACKGROUND@\  Force foreground or background mode.
  1732. @>BLOCK-CHECK@\  Level of packet error detection.
  1733. @>BUFFERS@\  Send and receive packet buffer sizes.
  1734. @>CARRIER@\  Treatment of carrier on terminal connections.
  1735. @>CASE@\  Controls treatment of alphabetic case.
  1736. @>COMMAND@\  Character set size for commands.
  1737. @>COUNT@\  For counted loops.
  1738. @>DEBUG@\  Log or display debugging information.
  1739. @>DEFAULT@\  Default directory.
  1740. @>DELAY@\  How long to wait before sending first packet.
  1741. @>DIAL@\  Parameters for DIAL command.
  1742. @>DUPLEX@\  Specify which side echoes during CONNECT.
  1743. @>ESCAPE@\  Prefix for "escape commands" during CONNECT.
  1744. @>FILE@\  Set various file parameters.
  1745. @>FLOW-CONTROL@\  Communication line full-duplex flow control.
  1746. @>HANDSHAKE@\  Communication line half-duplex turnaround character.
  1747. @>HOST@\  Specify network host name.
  1748. @>INCOMPLETE@\  Disposition for incompletely received files.
  1749. @>INPUT@\  Control behavior of INPUT command.
  1750. @>LANGUAGE@\  Enable language-specific character-set translations.
  1751. @>LINE@\  Communication line device name.
  1752. @>MACRO@\  Control aspects of macro execution.
  1753. @>MODEM-DIALER@\  Type of modem-dialer on communication line.
  1754. @>PAD@\  (X.25 systems only) X.3 PAD parameters.
  1755. @>PARITY@\  Communication line character parity.
  1756. @>PROMPT@\  The C-Kermit program's interactive command prompt.
  1757. @>RECEIVE@\  Parameters for inbound packets.
  1758. @>RETRY@\  Packet retransmission limit.
  1759. @>SCRIPT@\  Parameters for the SCRIPT command.
  1760. @>SEND@\  Parameters for outbound packets.
  1761. @>SERVER@\  Parameters for server operation.
  1762. @>SESSION-LOG@\  (UNIX only) Session log file type, text or binary.
  1763. @>SPEED@\  Communication line speed.
  1764. @>SUSPEND@\  Enable/Disable SUSPEND.
  1765. @>TAKE@\  Control aspects of TAKE file execution.
  1766. @>TERMINAL@\  Terminal parameters.
  1767. @>TRANSFER@\  File transfer parameters.
  1768. @>TRANSMIT@\  Control aspects of TRANSMIT command execution.
  1769. @>UNKNOWN@\  Specify handling of unknown character sets.
  1770. @>WINDOW@\  File transfer packet window size.
  1771. @>WILDCARD@\  (UNIX only) Kermit vs shell wildcard expansion.
  1772. @>X.25@\  (X.25 systems only) X.25 call parameters
  1773. @end(format)
  1774.  
  1775. The SHOW command may be used to display current settings.
  1776. Here is a  summary of settings available in C-Kermit, listed alphabetically.
  1777. @begin(d4)
  1778. @index<Attributes>
  1779. SET ATTRIBUTES@\ Tells C-Kermit whether to exchange
  1780. file attribute (A) packets@index<Attribute Packets>, or whether to include
  1781. specified attributes within the A packets it sends, or whether to pay
  1782. attention to specific attributes in A packets it receives.  When the use of
  1783. A packets has been negotiated, C-Kermit enables and uses the ones listed below.
  1784. When sending files, C-Kermit responds to an Attribute refusal from the other
  1785. computer by not sending the specified file.  For example, if C-Kermit
  1786. announces in the A packet that the file is 100K long, the other Kermit could
  1787. refuse the file because of insufficient disk space, and then C-Kermit would
  1788. not send it.
  1789. @begin(d4)
  1790. SET ATTRIBUTE CHARACTER-SET { ON, OFF }@\Turn the character-set attribute ON or
  1791. OFF.  If ON, C-Kermit includes a code for the transfer character set in the A
  1792. packet when sending a file, and when receiving a file, C-Kermit will translate
  1793. from the character set (if any) specified in the incoming A packet into the
  1794. current file character set (see SET FILE), if the transfer character set is
  1795. known to C-Kermit (see SET UNKNOWN).
  1796.  
  1797. SET ATTRIBUTE DATE { ON, OFF }@\If ON, C-Kermit includes the file's creation
  1798. date in the A packet when sending a file, and stores incoming files with the
  1799. creation dates (if any) given in the incoming A packets.  Beware: on some
  1800. computers, incremental backups might skip over files with creation dates older
  1801. than the most recent backup.
  1802.  
  1803. SET ATTRIBUTE DISPOSITION { ON, OFF }@\The MAIL and REMOTE PRINT commands work
  1804. by setting "dispositions" of Mail and Print in the A packet when sending a
  1805. file.  SET ATTR DISP OFF will cause C-Kermit to ignore this and store such
  1806. files on disk rather than mailing or printing them.
  1807.  
  1808. SET ATTRIBUTE LENGTH { ON, OFF }@\When sending files, C-Kermit puts their
  1809. length in the A packet, so the receiving system has an opportunity to check
  1810. and/or allocate disk space in advance, and to refuse the file if there is not
  1811. enough disk space.  If you believe that files are being unjustly refused on
  1812. the basis of length, you can SET ATTR LENGTH OFF.  When receiving files,
  1813. C-Kermit presently ignores the length announced in the A packet.
  1814.  
  1815. SET ATTRIBUTE OS-SPECIFIC { ON, OFF }@\Certain versions of Kermit convey
  1816. operating-system specific file information in the A packet, which is primarily
  1817. useful when transferring files between like systems, such as VMS to VMS.  If
  1818. you find this feature is interfering with successful file transfer, SET ATTR
  1819. OS OFF.
  1820.  
  1821. SET ATTRIBUTE SYSTEM-ID { ON, OFF }@\The A packet also includes a code
  1822. identifying the file's operating system of origin, so that the receiver of the
  1823. file can decide whether to pay attention to the OS-SPECIFIC attribute.  Use
  1824. SET ATTR SYS OFF to disable this feature.
  1825.  
  1826. SET ATTRIBUTES ALL { ON, OFF }@\You can turn all the above off using SET ATTR
  1827. ALL OFF, and back on using SET ATTR ALL ON.  
  1828.  
  1829. SET ATTRIBUTES { ON, OFF }@\This command turns the attribute mechanism itself
  1830. on or off, without disturbing the settings of the individual attributes.
  1831. It is on by default.
  1832. @end(d4)
  1833.  
  1834. SET BACKGROUND { OFF, ON }@\Use SET BACKGROUND off to make your prompts and
  1835. messages appear in case they have disappeared because Kermit thinks it is
  1836. running in the background (for example, if you are running it through an
  1837. output filter, as in "kermit | vt100").  You can accomplish the same effect
  1838. using the @q<-z> option on the command line.
  1839.  
  1840. SET BLOCK-CHECK {1, 2, 3}@\ Determines the level of per-packet error detection.
  1841. "1" is a single-@|character 6-bit checksum, folded to include the values of
  1842. all bits from each character.  "2" is a 2-character, 12-bit checksum.  "3" is
  1843. a 3-character, 16-bit cyclic redundancy check (CRC).  The higher the block
  1844. check, the better the error detection and correction and the higher the
  1845. resulting overhead.  Type 1 is most commonly used; it is supported by all
  1846. Kermit implementations, and it has proven adequate in most circumstances.
  1847. Types 2 or 3 should be used when transferring 8-bit data or when using long
  1848. packets.
  1849.  
  1850. SET BUFFERS @i<n1> @i<n2>@\Allows you to change the total buffer space used
  1851. for sending packets (@i<n1>) and receiving packets (@i<n2>), if Kermit has
  1852. been configured to allow dynamic buffer allocation.  The bigger you make them,
  1853. the longer your packets can be, and the more window slots you can use.  To see
  1854. the default values for your version of Kermit, type SHOW PROTOCOL.
  1855.  
  1856. SET CARRIER {AUTO, ON [@i<n>], OFF}@\Specifies C-Kermit's treatment of the
  1857. Carrier (CD, DCD, or RLSD) RS-232 signal on terminal device connections
  1858. obtained via SET LINE:
  1859. @begin(d4)
  1860. SET CARRIER ON@\Means to require carrier at all times;
  1861. SET LINE will not return until carrier appears (handy for setting Kermit up to
  1862. wait for a call to come in), and a fatal error will occur if carrier
  1863. disappears during CONNECT or file transfer.  A nice side effect is that when
  1864. you log out from the remote computer, you will be put back at C-Kermit prompt
  1865. level automatically if the remote system drops carrier properly.  If you want
  1866. to set a time limit on how long SET LINE will wait for carrier, you can
  1867. include an optional number after SET CARRIER ON to specify the number of
  1868. seconds to wait before timing out and returning to the prompt, for example SET
  1869. CARRIER ON 30.
  1870.  
  1871. SET CARRIER OFF means to ignore carrier at all times.  Useful for direct,
  1872. nonmodem connections, or misbehaving modem connections.  Should only be used
  1873. when necessary, because it takes away the ability of Kermit to automatically
  1874. detect a broken phone connection.
  1875.  
  1876. SET CARRIER AUTO means to require carrier during CONNECT but not at other
  1877. times.  AUTO is the default.  SET CARRIER ON does not affect the DIAL command.
  1878. @end(d4)
  1879.  
  1880. SET CASE { ON, OFF }@\Tells C-Kermit whether to pay attention to or ignore
  1881. alphabetic case in string matching operations, including INPUT and IF.
  1882. Default is OFF, i.e. ignore case.
  1883.  
  1884. SET COMMAND BYTESIZE { 7, 8 }@\Normally, C-Kermit's command processor strips
  1885. off the 8th bit of any character you type, in case your data connection to
  1886. C-Kermit has parity.  If there is no parity and you want to use an 8-bit
  1887. international character set in your commands (for example, in the ECHO
  1888. command, or in filenames), use SET COMMAND BYTESIZE 8.  The command also
  1889. applies to the connection between your terminal (if any) and C-Kermit during
  1890. terminal emulation (CONNECT), as opposed to the connection between C-Kermit
  1891. and the remote host (see SET TERMINAL BYTESIZE).
  1892.  
  1893. SET COUNT @i<n>@\For use with counted loops.  See the section on script
  1894. language programming.
  1895.  
  1896. SET DEFAULT @i<directory>@\Change default directory.  Equivalent to CD.
  1897.  
  1898. SET DIAL DISPLAY { ON, OFF }@\Show dialing activity on screen.
  1899.  
  1900. SET DIAL HANGUP { ON, OFF }@\Normally, the DIAL command will attempt to hang up
  1901. the phone before dialing a new call.  This is done by momentarily dropping the
  1902. Data Terminal Ready (DTR) signal on the currently selected terminal device.
  1903. Unfortunately, the method for doing this is ill-defined in some versions of
  1904. UNIX, and in some cases DTR goes down and stays down, which can prevent all
  1905. further communication between the computer and the modem.  If you find that
  1906. the DIAL command does not work for you at all, try giving the command SET DIAL
  1907. HANGUP OFF before giving the DIAL command.  This will prevent DIAL from
  1908. hanging up the phone before dialing the new call.
  1909.  
  1910. SET DIAL INIT-STRING @i<string>@\Replace Kermit's built-in initialization
  1911. string with @i<string>, which may contain backslash codes to represent control
  1912. characters.
  1913.  
  1914. SET DIAL MNP-ENABLE { ON, OFF }@\Enable or disable MNP protocol negotiations
  1915. by the modem.  Normally off.  This command presently applies only to Telebit
  1916. modems.
  1917.  
  1918. SET DIAL KERMIT-SPOOF { OFF, ON }@\Enable modem's "Kermit spoof" if it has
  1919. one.
  1920.  
  1921. SET DIAL SPEED-MATCHING { OFF, ON }@\Tells whether the modem's interface
  1922. speed is locked.  Default is OFF, meaning the modem changes its interface
  1923. speed to match the connection speed, for example if you place a call at 2400
  1924. bps and it is answered at 1200 bps.  Use ON if your modem is configured to
  1925. do speed matching.
  1926.  
  1927. SET DIAL TIMEOUT @i<number>@\Seconds to wait for a response from the modem
  1928. when dialing before giving up and declaring that the call could not be
  1929. completed.  If you don't give this command, Kermit calculates its own dial
  1930. timeout based on the modem type, length of the phone number, and transmission
  1931. speed.  If that interval isn't long enough, use this command to specify a
  1932. longer one.
  1933.  
  1934. SET DEBUG { ON, OFF, SESSION }@\SET DEBUG ON is equivalent to LOG DEBUG.  SET
  1935. DEBUG SESSION means to display incoming control and 8-bit characters on the
  1936. screen using special notation (see CONNECT).  SET DEBUG OFF turns off all
  1937. debugging.
  1938.  
  1939. SET DELAY @i(n)@\How many seconds to wait before sending the first packet
  1940. after a SEND command.  Used in remote mode to give you time to escape back to
  1941. your local Kermit and issue a RECEIVE command before the first Kermit packet
  1942. appears.  Normally 5 seconds.
  1943.  
  1944. SET DUPLEX {FULL, HALF}@\For use during CONNECT.  Specifies which side is doing
  1945. the echoing; FULL means the other side, HALF means C-Kermit must echo
  1946. your keystrokes itself.  Normally FULL.  Use half when communicating with IBM
  1947. mainframes over linemode connections, and on similar half-duplex or local-echo
  1948. connections.  Synonym: SET LOCAL-ECHO {OFF, ON}.
  1949.  
  1950. SET ESCAPE-CHARACTER @i(cc)@\For use during CONNECT to get C-Kermit's
  1951. attention.  The escape character acts as a prefix to an escape command, for
  1952. instance to close the connection and return to C-Kermit or UNIX command level.
  1953. The normal escape character is Control-Backslash (ASCII 28).  See CONNECT.
  1954.  
  1955. SET FILE @i<parameter> @i<value>@\
  1956. Establish file-related parameters:
  1957. @begin(d4)
  1958. SET FILE BYTESIZE { 7, 8 }@\Normally 8.  If 7, strip the 8th bit from
  1959. file data during file transfer.
  1960.  
  1961. SET FILE CHARACTER-SET @i<name>@\tells the encoding of the local file, ASCII by
  1962. default.  The names DUTCH, GERMAN, FRENCH, etc, refer to 7-bit ASCII-based
  1963. national replacement character (NRC) sets.  CP866, CYRILLIC-ISO,
  1964. and KOI8-CYRILLIC refer to sets used in the Soviet Union and other countries
  1965. that use the Cyrillic alphabet.  Latin-1 is the 8-bit ISO 8859
  1966. Latin Alphabet 1.  JAPANESE-EUC, DEC-KANJI, JIS7, and SHIFT-JIS are Japanese
  1967. Kanji sets.  Type SET FILE CHAR ? for a complete list.  When receiving
  1968. files, C-Kermit translates from the transfer character set specified in the
  1969. most recent SET TRANSFER CHARACTER-SET command or else the one announced in
  1970. the Attribute packet (if any) into the file character set.  When sending
  1971. files, C-Kermit translates from the current file character set into the
  1972. current transfer character set.
  1973.  
  1974. SET FILE COLLISION @i<action>@\Tells what to do when a file arrives that has
  1975. the same name as an existing file.  The actions are:
  1976. @begin(d4)
  1977.  
  1978. BACKUP@\(default) Rename the old file to a new, unique name and store the
  1979. incoming file under the name it arrived with.  The "new unique" name is simply
  1980. a new generation on VAX/VMS.  In UNIX, a "generation number" appended to the
  1981. filename, separated by a tilde, as in @q<oofa.txt.~8~>@foot{The new name for
  1982. the arriving file is of the form @q(foo.~)@i(n)@q(~), where foo is the name
  1983. they share and @i(n) is a "generation number"; if @i(foo) exists, then the new
  1984. file will be called @q(foo.~1~).  If @q(foo) and @q(foo.~1~) exist, the new
  1985. file will be @q(foo.~2~), and so on.  If the new name would be longer than the
  1986. maximum length for a filename, then characters are deleted from the end first,
  1987. for instance, @q(thelongestname) on a system with a limit of 14 characters
  1988. would become @q(thelonges.~1~).}
  1989. @begin(quotation)
  1990. WARNING: UNIX C-Kermit presently offers no
  1991. method of automatically limiting the number of versions of a file that can be
  1992. created, so if too many of them pile up, you'll have to delete the ones you
  1993. don't need by hand.  Or, because the version number syntax is compatible with
  1994. GNU EMACS backup files, you can use EMACS to do this for you.
  1995. @end(quotation)
  1996. In OS/2, Kermit constructs names of the form
  1997. @q(FZZ)@i(n)@q(.BAR), where @q(FZZ.BAR) is the name they share and @i(n) is
  1998. a "generation number"; if @q(FZZ.BAR) exists, then the new file will be
  1999. called @q(FZZ00001.BAR).  If @q(FZZ.BAR) and @q(FZZ00001.BAR) exist, the
  2000. new file will be @q(FZZ00002.BAR), and so on.  If the common name were
  2001. more than 6 characters long (eg @q(GOODDATA.DAT)), then the new name for the
  2002. arriving file would be @q(GOODD001.DAT) and so on.
  2003.  
  2004. OVERWRITE@\Overwrite (replace) the existing file.  The existing file is gone,
  2005. destroyed.  Even if the file transfer fails or the incoming file is refused.
  2006. Use with caution.
  2007.  
  2008. APPEND@\Append the incoming file to the end of the existing file.  This option
  2009. is useful for adding information to a log file, but it should be used with
  2010. caution to avoid, for example, joining two files of different types (like text
  2011. and binary).
  2012.  
  2013. DISCARD@\Refuse and/or discard the incoming file.  This option is handy for
  2014. resuming multi-file transmissions that were broken.  Only those files that
  2015. were not successfully transferred before will be accepted.
  2016.  
  2017. RENAME@\Give the incoming file a unique name, like the BACKUP option, except
  2018. that the incoming file gets the new name, rather than the existing file.
  2019.  
  2020. UPDATE@\Accept the incoming file only if it is newer than the existing file.
  2021. This feature depends on the creation date field in the attribute packet.
  2022. @end(d4)
  2023.  
  2024. SET FILE DISPLAY { ON, OFF }@\Normally ON; when in local mode, display progress
  2025. of file transfers on the screen (stdout), and watch the keyboard for
  2026. interruptions.  If OFF (-q on command line) none of this is done, and the file
  2027. transfer may proceed in the background oblivious to any other work
  2028. concurrently done at the keyboard.
  2029.  
  2030. SET FILE NAMES {CONVERTED, LITERAL}@\Normally CONVERTED, which means that
  2031. outbound filenames have device, directory, and/or path specifications
  2032. stripped, lowercase letters raised to upper, tildes and extra periods changed
  2033. to X's, and an X inserted in front of any name that starts with period.  In
  2034. VMS, the generation number is also stripped.  For UNIX only, incoming
  2035. filenames have uppercase letters lowered.  LITERAL means that none of these
  2036. conversions are done; therefore, any directory path appearing in a received
  2037. file specification must exist and be write-accessible.  When literal naming is
  2038. being used, the sender should not use path names in the file specification
  2039. unless the same path exists on the target system and is writable.
  2040.  
  2041. SET FILE RECORD-LENGTH @i<n>@\Tells the record length for fixed-format files,
  2042. or the maximum record length for variable-format files, on systems like
  2043. VAX/VMS where record-length is a meaningful concept.
  2044.  
  2045. SET FILE TYPE {BINARY, TEXT}@\The file type is normally text, which
  2046. means that conversion is done between the local computer's record format and
  2047. Kermit's standard transfer format, for example between UNIX newline characters
  2048. and Kermit's carriage-@|return/@|linefeed sequences.  BINARY means to transmit
  2049. file contents without conversion.  Binary (`@q(-i)' in command line notation)
  2050. is necessary for binary files, and desirable in all file transfers between
  2051. like systems to cut down on overhead.
  2052.  
  2053. For VAX/VMS, these are the file type options:
  2054.  
  2055. SET FILE TYPE TEXT@\Regular Text mode.  Applies to incoming files only.  When
  2056. SENDing files, C-Kermit determines their type automatically.
  2057.  
  2058. SET FILE TYPE BINARY [ { FIXED, UNDEFINED } ]@\Applies to incoming files only.
  2059. Binary mode: incoming files are stored with no translation or conversion.
  2060. The default record format is FIXED, but you can specify UNDEFINED too.
  2061.  
  2062. SET FILE TYPE IMAGE@\This one applies to both incoming and outbound files.
  2063. For incoming files, it's just like BINARY FIXED.  For outbound files, it means
  2064. just send the blocks of the file as they are stored on the disk, and ignore
  2065. the file's RMS attributes.  SET FILE TYPE BLOCK is a synonym (for
  2066. compatibility with Kermit-32).
  2067.  
  2068. SET FILE WARNING { ON, OFF }@\SET FILE WARNING is an old command, somewhat
  2069. misnamed.  SET FILE COLLISION (above) should be used instead.  SET FILE
  2070. WARNING ON is equivalent to SET FILE COLLISION
  2071. RENAME and SET FILE WARNING OFF is equivalent to SET FILE COLLISION OVERWRITE.
  2072. @end(d4)
  2073.  
  2074. @begin<multiple>
  2075. SET FLOW-CONTROL {DTR/CD, NONE, RTS/CTS, XON/XOFF}@\Normally XON/XOFF for full
  2076. duplex flow control.  Should be set to NONE if the other system cannot do
  2077. Xon/Xoff flow control, or if you have issued a SET HANDSHAKE command.  If set
  2078. to XON/XOFF, then HANDSHAKE should be set to NONE.  This setting applies
  2079. during both terminal connection and file transfer.  @i<Warning:> This command
  2080. may have no effect on certain UNIX systems, where Kermit puts the
  2081. communication line into "rawmode" and rawmode precludes flow control.
  2082.  
  2083. The DTR/CD and RTS/CTS options are two kinds of "hardware flow control", using
  2084. special wires (other than the data wires) in the connector.  These forms of
  2085. flow control (especially RTS/CTS) are especially useful with high-speed
  2086. modems and similar devices.  But these options are only available in those
  2087. versions of C-Kermit whose underlying operating system supports them.
  2088.  
  2089. Certain versions of UNIX, such as that on the NeXT, provide RTS/CTS flow
  2090. control in a different way, namely in the device driver.  For example,
  2091. /dev/cua is the first dialout port on the NeXT without RTS/CTS flow control,
  2092. and /dev/cufa is the same port, but with built-in RTS/CTS flow control.
  2093.  
  2094. @end<multiple>
  2095.  
  2096. SET HANDSHAKE {XON, XOFF, CR, LF, BELL, ESC, NONE}@\Normally NONE.  Otherwise,
  2097. half-duplex communication line turnaround handshaking is done during file
  2098. transfer, which means C-Kermit will not reply to a packet until it has
  2099. received the indicated handshake character or has timed out waiting for it;
  2100. the handshake setting applies only during file transfer.  If you SET HANDSHAKE
  2101. to other than NONE, then FLOW should be set to NONE.
  2102.  
  2103. SET HOST @i<name>@\For communicating over a network rather than a terminal
  2104. device.  Presently supported only for Berkeley-based or other UNIX
  2105. implementations using the socket interface to a TCP/IP network, for VAX/VMS
  2106. with the TGV MultiNet TCP/IP package, and for
  2107. SunLink X.25.  For TCP/IP networks, the @i<name> is the hostname or IP host
  2108. number of a host on the network, optionally followed by a colon and an IP
  2109. service number.  By default, C-Kermit connects to the telnet (virtual terminal
  2110. server) socket on TCP/IP connections.  For X.25 networks, the @i<name> is the
  2111. X.121 address.
  2112.  
  2113. SET INCOMPLETE {DISCARD, KEEP}@\Disposition for incompletely received files.
  2114. If an incoming file is interrupted or an error occurs during transfer,
  2115. the part that was received so far is normally discarded.  If you SET
  2116. INCOMPLETE KEEP then partial files will be kept.
  2117.  
  2118. SET INPUT {CASE, ECHO, TIMEOUT-ACTION}@\Controls the behavior of the INPUT
  2119. command.  See the section on script programming.
  2120.  
  2121. SET KEY @i<n> [ @i<string> ]@\Key mapping for CONNECT mode.  Tell Kermit that
  2122. when you press the key whose code is @i<n> during CONNECT mode, it should
  2123. substitute the @i<string> in its place.  The string is entered in the native
  2124. character set of your computer, or you can use backslash codes.  The
  2125. characters are subject to the same translation and shifting rules as the
  2126. characters you would enter manually at the keyboard during CONNECT mode.  The
  2127. code @i<n> must be a number between 0 and 255 (higher numbers are possible on
  2128. some computers, like OS/2, if Kermit knows how to read your computer's
  2129. keyboard scan codes).  A key mapping for code @i<n> applies to @i<all> keys
  2130. that produce this code, for example SET KEY \9 \27 assigns the code 27 (ESC)
  2131. to the TAB key and to the CTRL-I key.  To find out a key's code, enter the
  2132. SHOW KEY command, then press the key or key combination.  Entering the SET KEY
  2133. for key @i<n> without specifying a @i<string> results in removing any previous
  2134. key mapping for key @i<n>, i.e. @i<n> sends itself.  Key mappings do not apply
  2135. to escape-character arguments.  If the escape character appears in a SET KEY
  2136. @i<string>, it is treated as an ordinary data character, but if a key
  2137. definition is exactly one character long, and that character is the escape
  2138. character, it is treated as the escape character.
  2139.  
  2140. SET LANGUAGE {ICELANDIC, GERMAN, NORWEGIAN, RUSSIAN, ...}@\For use with
  2141. international text file transfer.  If you tell Kermit what language a text
  2142. file is written in, then Kermit might be able to apply certain transliteration
  2143. tricks when translating between the file character set and the transfer
  2144. character set.  See the section on international character sets.
  2145.  
  2146. SET LINE [@i<terminal-device-name>]@\
  2147. @begin<multiple>
  2148. The device name for the communication line to be used for file transfer and
  2149. terminal connection, e.g. @q(/dev/ttyi3) on a UNIX system or @q<TXA0:> on a
  2150. VAX/VMS computer.  If you specify a device name,
  2151. Kermit will be in @i<local mode>, and you should remember to issue any other
  2152. necessary SET commands, such as SET SPEED (on UNIX, at least, the SET SPEED
  2153. command is not strictly necessary -- Kermit will use the line's current speed,
  2154. but you should use SET SPEED anyway, so that you be sure that speed you desire
  2155. is actually being used).
  2156.  
  2157. If you omit the device name, Kermit will revert to its default mode of
  2158. operation.  If you specify the default device name (@q(/dev/tty) in UNIX,
  2159. @q<TT:> in VMS), Kermit will enter remote mode (useful when logged in through
  2160. the "back port" of a system normally used as a local-mode workstation).
  2161.  
  2162. Whenever you give a SET LINE command, C-Kermit closes any currently open
  2163. communication device before attempting to open the new one.  Therefore SET
  2164. LINE is also useful for closing and hanging up a dialed connection.
  2165.  
  2166. When UNIX Kermit enters local mode, it attempts to synchronize with other
  2167. programs (like uucp) that use external communication lines so as to prevent
  2168. two programs using the same line at once; before attempting to lock the
  2169. specified line, it will close and unlock any external line that was previously
  2170. in use.  If your system does not allow you to have write access to the uucp
  2171. lock directory, then you will receive a message like "Sorry, access to lock
  2172. denied."  In this case, you must ask your system administrator to ensure that
  2173. uucp lockfiles are set up correctly and Kermit is installed correctly.  If
  2174. Kermit were to use the external line without proper coordination with uucp
  2175. (and even other copies of Kermit), then two or more users could find
  2176. themselves using the same line at the same time, which would prevent all
  2177. useful communication.
  2178.  
  2179. If you SET LINE to a communication port that has a modem attached, and you
  2180. have SET CARRIER ON, then the SET LINE command will not return until carrier
  2181. appears on the device.  This is useful for setting up a Kermit program that
  2182. other people can dial in to.  You can control the amount of time Kermit will
  2183. wait for carrier using SET CARRIER ON @i<n>, where n is the number of seconds
  2184. to wait for a connection before timing out.  You can also interrupt a blocked
  2185. SET LINE command by typing Ctrl-C.
  2186. @end<multiple>
  2187.  
  2188. SET MACRO { ECHO, ERROR } { ON, OFF }@\Tells whether the individual commands
  2189. that comprise a macro should be echoed on the screen during macro execution
  2190. (normally they are not), and whether an error during macro execution should
  2191. terminate the macro immediately (normally it does not).  See the section on
  2192. script programming.
  2193.  
  2194. SET MODEM-DIALER @i<name>@\The type of
  2195. modem @index<Autodialer> dialer on the communication line; the @i<name>
  2196. identifies the modem type: DIRECT, HAYES, RACALVADIC, VENTEL, etc.  "Direct"
  2197. indicates either there is no dialout modem, or that if the line requires
  2198. carrier detection to open, then SET LINE will hang waiting for an incoming
  2199. call.  HAYES, VENTEL, and the others indicate that SET LINE will prepare for a
  2200. subsequent DIAL command for the given dialer.  UNKNOWN means a modem is
  2201. attached, but of an unknown or unsupported type.  Support for new dialers is
  2202. added from time to time, so type SET MODEM ? for a list of those supported in
  2203. your copy of Kermit.  Also see the description of the DIAL and SET DIAL
  2204. commands.  @i<NOTE:> the SET MODEM command must be given @i<before> the SET
  2205. LINE command if you plan to use the DIAL command.
  2206.  
  2207. SET NETWORK {TCP/IP, X.25}@\Select the type of network that is to be used for
  2208. SET HOST connections.  TCP/IP is presently available for UNIX systems that
  2209. support the Berkeley sockets library (such as BSD-based UNIXes, HP-UX, Xenix
  2210. with Excelan TCP/IP) and for VAX/VMS with the TGV MultiNet library.
  2211. X.25 is available only for SUNs with the SunLink product (see section on X.25
  2212. support).
  2213.  
  2214. SET PAD@\(See X.25 section)
  2215.  
  2216. SET PARITY {EVEN, ODD, MARK, SPACE, NONE}@\Specify character parity for use in
  2217. packets and terminal connection, normally NONE.  If other than NONE, C-Kermit
  2218. will seek to use the 8th-bit prefixing mechanism for transferring 8-bit data,
  2219. which can be used successfully only if the other Kermit agrees during the
  2220. automatic feature negotiation phase; if not, 8-bit data cannot be successfully
  2221. transferred.  In Berkeley-based UNIX implementations, if you SET PARITY to
  2222. other than NONE, this will also enable Xon/Xoff flow control during file
  2223. transfer if FLOW is set to XON/XOFF; otherwise, flow control is not done
  2224. (because the communication line must be opened in "raw mode" for 8-bit data,
  2225. which precludes the use of Xon/Xoff flow control in Berkeley UNIX).
  2226.  
  2227. SET PROMPT [@i<text>]@\The given text will be substituted for "@q(C-Kermit)>"
  2228. as this program's prompt.  If the text is omitted, the prompt will revert to
  2229. "@q(C-Kermit>)".  If the text is enclosed in { curly braces }, the braces are
  2230. stripped and any leading and trailing blanks are retained.  The text may
  2231. contain backslash codes.
  2232.  
  2233. SET QUIET {ON, OFF}@\Normally OFF.  Various informational messages are issued
  2234. by the user interface.  ON suppresses these messages (but not error messages).
  2235. Equivalent to '-q' on the command line.
  2236.  
  2237. SET RECEIVE @i<parameter> @i<value>@\(See SET SEND.)
  2238.  
  2239. SET RETRY @i<n>@\Specify the maximum number of times a particular packet
  2240. can be retransmitted (because of timeout or transmission errors) before Kermit
  2241. gives up and declares the file transfer a failure.
  2242.  
  2243. SET {SEND, RECEIVE} @i<parameter> @i<value>@\@begin(multiple)
  2244. These commands are used to modify the normal formats and procedures used by
  2245. the Kermit file transfer protocol.  Normally they are not necessary, but they
  2246. can be used to overcome unusual obstacles, or to improve Kermit's performance.
  2247.  
  2248. The SET RECEIVE command lets you tell the other Kermit how it should format
  2249. the packets it sends to you.  Give SET RECEIVE commands to the Kermit that is
  2250. going to receive files.  If you plan to transfer files in both directions,
  2251. give SET RECEIVE commands to both Kermits.
  2252.  
  2253. The SET SEND command rarely needs to be used.  It is for overriding what the
  2254. the other Kermit requests, and should be necessary only if you cannot use a
  2255. SET RECEIVE command to modify the parameter in question on the receiving
  2256. Kermit.
  2257. @end(multiple)
  2258. @begin(d4)
  2259. SET {RECEIVE, SEND} END-OF-PACKET @i(cc)@\Specifies the control character that
  2260. marks the end of a Kermit packet.  Normally 13 (carriage return), which most
  2261. Kermit implementations require.
  2262.  
  2263. SET {RECEIVE, SEND} PACKET-LENGTH @i(n)@\Specify the maximum packet length,
  2264. normally 90.  Shorter packet lengths can be useful on noisy lines, or with
  2265. systems or front ends or networks that have small buffers.  The shorter the
  2266. packet, the higher the overhead, but the lower the chance of a packet being
  2267. corrupted by noise, and the less time to retransmit corrupted packets.  If you
  2268. request a length greater than 94, "long packets" are used, which is a feature
  2269. that not all other Kermit programs support (most popular ones do).  C-Kermit
  2270. can send and receive packets up to about 2000 characters in length.  If you
  2271. use longer packets, you should also request a stronger error checking method
  2272. (see SET BLOCK-CHECK).  SET SEND PACKET-LENGTH overrides the value requested
  2273. by the other Kermit during protocol initiation unless the other Kermit
  2274. requests a shorter length.
  2275.  
  2276. SET {RECEIVE, SEND} PAD-CHARACTER @i(cc)@\SET RECEIVE PAD-CHARACTER allows
  2277. C-Kermit to request the other Kermit to use @i(cc) as a pad character.
  2278. Default @i(cc) is NUL, ASCII 0.  C-Kermit normally does not need to have
  2279. incoming packets preceded with pad characters.  SET SEND PAD-CHARACTER
  2280. designates a character to send before each packet.  Normally, none is sent.
  2281. Outbound padding is sometimes necessary for communicating with slow half
  2282. duplex systems that provide no other means of line turnaround control.  It can
  2283. also be used to send special characters to communications equipment that needs
  2284. to be put in "transparent" or "no echo" mode, when this can be accomplished in
  2285. by feeding it a certain control character.
  2286.  
  2287. SET {RECEIVE, SEND} PADDING @i(n)@\How many pad characters to request or send,
  2288. normally 0.
  2289.  
  2290. SET {RECEIVE, SEND} START-OF-PACKET @i(number)@\The normal Kermit packet
  2291. prefix is Control-A (1); this command changes the prefix C-Kermit puts on
  2292. outbound packets.  The only reasons this should ever be changed would be: Some
  2293. piece of equipment somewhere between the two Kermit programs will not pass
  2294. through a Control-A; or, some piece of of equipment similarly placed is
  2295. echoing its input.  In the latter case, the recipient of such an echo can
  2296. change the packet prefix for outbound packets to be different from that of
  2297. arriving packets, so that the echoed packets will be ignored.  The opposite
  2298. Kermit must also be told to change the prefix for its inbound packets (use SET
  2299. RECEIVE START on one Kermit and SET SEND START on the other).
  2300.  
  2301. SET {RECEIVE, SEND} TIMEOUT @i(n)@\Normally, each Kermit partner sets its
  2302. packet timeout interval based on what the opposite Kermit requests.  SET
  2303. RECEIVE TIMEOUT allows you to override the normal procedure and specify a
  2304. timeout interval for C-Kermit to use when waiting for packets from the other
  2305. Kermit.  If you specify 0, then no timeouts will occur, and C-Kermit will wait
  2306. forever for expected packets to arrive (relying on the other Kermit to provide
  2307. the timeout function).  SET SEND TIMEOUT specifies the number of seconds to
  2308. wait for a packet before timing it out and retransmitting or requesting
  2309. retransmission.
  2310. @end(d4)
  2311.  
  2312. SET SCRIPT ECHO {ON, OFF}@\Tell whether the SCRIPT command should echo its
  2313. interactions with the remote host on your screen.  ON by default.
  2314.  
  2315. SET SERVER DISPLAY {ON, OFF}@\Specify whether C-Kermit, when in server mode,
  2316. should put a file transfer display on the screen when it is in local mode.
  2317. Normally OFF.
  2318.  
  2319. SET SERVER TIMEOUT @i<n>@\Specify the time interval @i<n> in
  2320. seconds for the C-Kermit server to send NAK packets while waiting for a
  2321. command packet.  These NAKs are intended to break deadlocks in case a client
  2322. Kermit that cannot time out sends a command packet which is lost.  However,
  2323. the server command-wait NAKs can interfere with originate/answer devices that
  2324. are to be used for answering.  For example, you can run a C-Kermit server on a
  2325. modem line that normally dials out, so that people can dial in to it and give
  2326. Kermit commands.  While waiting for the phone call to come, the server NAKs
  2327. might "wake up" the modem and put it into originate mode, preventing the
  2328. incoming call from being answered.
  2329.  
  2330. SET SESSION-LOG { BINARY, TEXT }@\Specify how the session log is to be
  2331. written.  TEXT is the default, meaning that lines are written using the
  2332. convention of the local system; for example, UNIX session logs will have
  2333. carriage returns (and certain other extraneous characters like NUL) omitted.
  2334. BINARY means to record all characters in the session log.
  2335.  
  2336. SET SPEED @i<n>@\The transmission speed in bits per second
  2337. ("baud rate") for the communication line specified in SET LINE (but not SET
  2338. HOST).  This command cannot be used to change the speed of your own console
  2339. terminal.  Some computers are set up in such a way that you must give this
  2340. command after a SET LINE command before you can use the line.  Type SET SPEED
  2341. ? to see what speeds are available.  Use speeds greater than 9600 with
  2342. caution, since they are not necessarily supported by the communication devices
  2343. on your computer or the other computer, or the communication path between them.
  2344.  
  2345. SET SUSPEND { OFF, ON }@\(UNIX only) On UNIX versions that support job
  2346. control, C-Kermit can normally be put in the background by typing the
  2347. suspend character (usually Ctrl-\), or giving C-Kermit the SUSPEND (or Z)
  2348. command, or by using the Z connect-mode escape.  SET SUSPEND OFF disables
  2349. this feature.  This is useful when suspending doesn't work right (e.g. on
  2350. certain UNIX implementations that have bugs) or when you are running Kermit
  2351. under the Bourne shell.
  2352.  
  2353. SET TAKE { ECHO, ERROR } { ON, OFF }@\SET TAKE ECHO tells whether
  2354. commands from a TAKE file are displayed on the screen as they are executed
  2355. (normally they are not).  SET TAKE ERROR controls whether execution of a TAKE
  2356. command file should be terminated if an error occurs (normally it is not).
  2357.  
  2358. SET TERMINAL @i<parameter> @i<value>@\Used for specifying terminal parameters.
  2359. @begin(d4)
  2360. SET TERMINAL BYTESIZE { 7, 8 }@\tells the character size to be used on the
  2361. communication line between the local C-Kermit and the remote Kermit during
  2362. terminal emulation (C-Kermit CONNECT command).  It's 7 by default, which means
  2363. that the high-order (8th) bit is stripped from each incoming and outgoing
  2364. character.  Use 8 for 8-bit character sets like ISO Latin Alphabet 1, but this
  2365. will work only if the connection really is 8-bits no-parity.  Compare with
  2366. SET COMMAND BYTESIZE.
  2367.  
  2368. SET TERMINAL CHARACTER SET <remote-set> [ <local-set> ]@\For use during
  2369. CONNECT.  Specify the character set that is being sent to C-Kermit by the
  2370. remote computer, and specify which local character set to translate it into.
  2371. If the local character set is omitted, the current file character set is used.
  2372. The choices for the character sets are the same as for C-Kermit's file
  2373. character sets (see SET FILE CHARACTER-SET).  SET TERMINAL CHARACTER-SET
  2374. TRANSPARENT (which is Kermit's startup default) means no translation is done.
  2375. Equivalently, no translation is done if the local and remote sets are
  2376. specified to be the same.  When they are different, translation goes through
  2377. the Latin Alphabet 1 unless the local character set is Cyrillic-based in which
  2378. case it goes through the Latin/Cyrillic Alphabet.  Kanji terminal
  2379. character-sets are not supported.
  2380.  
  2381. SET TERMINAL LOCKING-SHIFT { OFF, ON }@\Tells C-Kermit whether to use
  2382. Shift-In/Shift-Out (Ctrl-O and Ctrl-N) to switch between 7-bit and 8-bit
  2383. characters during CONNECT.  Applies to the Kermit-to-remote part of the
  2384. connection only, and it applies to both the characters you type and to
  2385. those Kermit receives from the remote.  OFF by default.
  2386.  
  2387. SET TERMINAL NEWLINE { ON, OFF }@\OFF is the default.  When ON, Kermit
  2388. sends CRLF whenever you type CR during terminal emulation.
  2389.  
  2390. SET TERMINAL TYPE { VT100, TEK }@\(OS/2 C-Kermit only) Select the type of
  2391. terminal to emulate.
  2392. @end(d4)
  2393. Terminal parameters can be displayed with the SHOW TERMINAL command.
  2394.  
  2395. SET TRANSFER CHARACTER-SET @i<name>@\Tells what character set should be used
  2396. for file data within Kermit packets during transfer of text files.  The
  2397. choices are:
  2398. @begin(d4)
  2399. TRANSPARENT@\Don't translate characters at all.
  2400.  
  2401. ASCII@\Means to use the 7-bit ASCII (American Standard Code for Information
  2402. Interchange) character set.  If the local file character set contains
  2403. characters that do not occur in ASCII (like accented letters), represent them
  2404. in ASCII the best way possible.
  2405.  
  2406. CYRILLIC-ISO@\Means to use the ISO 8859-5 Latin/Cyrillic Alphabet, which is
  2407. capable of representing Russian, Ukrainian, Bulgarian, Serbian, etc.
  2408.  
  2409. LATIN1@\Means to use ISO 8859 Latin Alphabet 1, which is capable of
  2410. representing most western European languages (English, German, Spanish, Dutch,
  2411. Italian, Norwegian, Danish, Swedish, Portuguese, etc).
  2412.  
  2413. JAPANESE-EUC@\Means to use Japanese Extended UNIX Code, which is a mixture of
  2414. 7-bit Roman (Japanese ISO 646, similar to ASCII), single-byte Katakana, and
  2415. double-byte JIS X 0208 Kanji.
  2416. @end(d4)
  2417.  
  2418. SET TRANSMIT @i<parameter> @i<value>@\Controls the behavior of the TRANSMIT
  2419. command, used for uploading files to computers that don't have Kermit
  2420. programs.  See TRANSMIT.  The parameters are:
  2421. @begin(d4)
  2422. ECHO { OFF, ON }@\Controls whether the characters that are sent to the other
  2423. computer are also displayed on your screen.  The default is ON.
  2424.  
  2425. EOF @i<string>@\String to send after sending the file, for example
  2426. SET TRANSMIT EOF \4 to send a Ctrl-D.
  2427.  
  2428. FILL @i<character>@\ASCII value of character to insert into blank lines.  Some
  2429. computers ignore blank lines, others might terminate the upload when they
  2430. receive a blank line.  Use this command to insert a character, such as space
  2431. (32) or X (88), in any blank line.
  2432.  
  2433. LINEFEED { ON, OFF }@\Transmit linefeed as well as carriage return at the end
  2434. of each line.  Normally, only CR is sent.
  2435.  
  2436. LOCKING-SHIFT { ON, OFF }@\Whether to send the locking-shift characters SO
  2437. (Ctrl-N) and SI (Ctrl-O) around 8-bit characters when transmitting and PARITY
  2438. is not NONE.
  2439.  
  2440. PAUSE @i<n>@\Number of milliseconds (1000 milliseconds = 1 second) to pause
  2441. after sending each line of a text file, or each character of a binary file
  2442. (according to SET FILE TYPE).  Maximum 1000, default 0.
  2443.  
  2444. PROMPT @i<n>@\ASCII value of character to look for from host before
  2445. sending next line, normally LF (10), in text mode only; 0 means not to wait
  2446. for any responses from the host -- just send all the characters in a steady
  2447. stream.  This command has no effect in binary mode (i.e. when FILE TYPE is set
  2448. to BINARY).
  2449. @end(d4)
  2450. Synonym: SET XMIT.
  2451.  
  2452. SET UNKNOWN-CHAR-SET { DISCARD, KEEP }@\Tells what to do if a file arrives
  2453. whose Attribute packet announces a transfer character set unknown to C-Kermit.
  2454.  
  2455. SET WILDCARD-EXPANSION { KERMIT, SHELL }@\(UNIX only) Tells who should expand
  2456. wildcard characters in SEND and similar commands: KERMIT (the default) or the
  2457. user's preferred UNIX shell (such as sh, csh, or ksh).
  2458.  
  2459. @begin(multiple)
  2460. SET WINDOW @i<n>@\Select a window size.  This refers to Kermit's sliding window
  2461. packet transport protocol.  Normally, Kermit sends a packet, waits for the
  2462. reply, then sends the next packet, and so on.  This is called "stop and wait"
  2463. operation, corresponding to a window size of 1, and is supported by all Kermit
  2464. programs.  If you select a window size greater than 1, and if the other Kermit
  2465. supports sliding windows, then multiple packets (up to the window size) can be
  2466. sent before any replies are required.  This allows file transfer to operate
  2467. efficiently over connections that have long delays, like over public data
  2468. networks or through satellites.
  2469.  
  2470. With a sufficiently large window size, transmission can be continuous with no
  2471. pauses or delays.  The maximum window size is 31, but sizes greater than 5 or
  2472. 10 are rarely necessary.
  2473.  
  2474. Sliding windows may be used in conjunction with long packets, but the maximum
  2475. length for packets decreases with increasing window size.
  2476.  
  2477. Kermit uses the "selective retransmission" technique, so that if packets are
  2478. damaged during sliding windows transfers, only the damaged packets are
  2479. retransmitted.
  2480. @end(multiple)
  2481.  
  2482. SET X.25@\(See X.25 section)
  2483. @end(d4)
  2484.  
  2485. @subheading(The SHOW Command)
  2486.  
  2487. Syntax: @q<SHOW> @i<category> 
  2488.  
  2489. The SHOW command with the default argument of "parameters" displays
  2490. the values of most of the SET parameters described above.  If you type
  2491. a category name after SHOW, then a more detailed report of parameters within
  2492. the named category are displayed, for example SHOW COMMUNICATIONS, SHOW
  2493. PROTOCOL.  Type SHOW ? to see a list of the available categories.
  2494.  
  2495. @section(Backslash Notation)
  2496. @label(-bkslash)
  2497.  
  2498. @q<\> (backslash) in any command means that what follows is not ordinary text,
  2499. but rather a code, variable, or function whose value is to be substituted into
  2500. the command at that point.  The character after the backslash identifies which
  2501. kind of quantity this is:
  2502. @begin(description,leftmargin +6,indent -2,spread 0)
  2503. @q<%>@\A user-defined simple (scalar) variable
  2504.  
  2505. @q<&>@\an array reference
  2506.  
  2507. @q<$>@\an environment variable
  2508.  
  2509. @q<v>@\(or @q<V>) a built-in variable
  2510.  
  2511. @q<f>@\(or @q<F>) a function
  2512.  
  2513. @q<d>@\(or @q<D>) a decimal (base 10) number
  2514.  
  2515. @q<o>@\(or @q<O>) an octal (base 8) number
  2516.  
  2517. @q<x>@\(or @q<X>) a hexadecimal (base 16) number
  2518.  
  2519. @q<\>@\the backslash character itself
  2520.  
  2521. @q<\b>@\(or @q<\B>) the BREAK signal (OUTPUT command only)
  2522.  
  2523. @q<\l>@\(or @q<\L>) a Long BREAK signal (OUTPUT command only)
  2524.  
  2525. @i<a decimal digit>@\a 1-3 digit decimal number.
  2526.  
  2527. @i<anything else>@\The following character is taken literally.
  2528. @end(description)
  2529. Variables, arrays, functions, etc, are explained in the next section.
  2530. Numbers can be expressed in backslash notation in the following ways:
  2531. @begin(d4)
  2532. @q<\{...}>@\A grouped number, braces discarded, e.g. \{17}5 is not the same as
  2533. \175.
  2534.  
  2535. @q<\>@i<nnn>@\(1-3 decimal digits) replaced by binary number 0-255, e.g.
  2536. @q<\13> represents carriage return (ASCII 13).
  2537.  
  2538. @q<\d>@i<nnn> or @q<\D>@i<nnn> - Same as @q<\>@i<nnn>
  2539.  
  2540. @q<\o>@i<nnn> or @q<\O>@i<nnn> (1-3 octal digits) replaced by binary number
  2541. 0-255.
  2542.  
  2543. @q<\x>@i<nn> or @q<\X>@i<nn> (2 hexadecimal digits) replaced by binary number
  2544. 0-255.
  2545. @end(d4)
  2546. Numbers expressed in backslash notation are typically used to express
  2547. nonprintable ASCII characters within character strings, or in commands that
  2548. want you to enter the ASCII value of a character.  Examples:
  2549. @begin(example)
  2550. echo \7Wake up!\7            ; A message with beeps
  2551. echo \27[H\27[J              ; VT100 clear-screen sequence
  2552. set pad-character \o177      ; The ASCII character DEL
  2553. @end(example)
  2554.  
  2555. @section(Macros, Variables, and Script Programming)
  2556. @label(-macros)
  2557.  
  2558. C-Kermit's script programming language is based upon that of MS-DOS Kermit,
  2559. and it is in most ways upwards compatible with it, meaning that many MS-DOS
  2560. Kermit script programs (or TAKE files in general) will work in C-Kermit with
  2561. little or no modification.  C-Kermit also has a SCRIPT command that provides
  2562. a terse but cryptic shorthand for automating certain kinds of interactive
  2563. operations (see Section @ref<-scrcmd>).
  2564.  
  2565. @subsection(Variables)
  2566.  
  2567. A variable name is of the form @q<\%@i(i)>, where @i(i) is a single letter or
  2568. digit.  Letter-variables are different from digit-variables, which are used as
  2569. macro parameters.  The alphabetic case of a letter-variable doesn't matter:
  2570. @q<\%a> is the same variable as @q<\%A>.
  2571.  
  2572. All variables have character strings as values.  A variable is considered to
  2573. exist if its value is a string of at least one character in length, otherwise
  2574. it is "undefined" and does not exist.
  2575.  
  2576. A value is given to a variable using the DEFINE or ASSIGN command:
  2577. @begin(d4)
  2578. DEFINE @i<name> [ @i<text> ]@\The named variable (or macro, see below) is
  2579. created, with @i<text> as a value.  If a macro or variable of the given name
  2580. already exists, its definition is replaced with the new one.  The given text
  2581. is copied into the definition literally.  If it contains any variable names,
  2582. functions references, etc, these are simply copied, rather than evaluated.
  2583.  
  2584. ASSIGN @i<name> @i<text>@\The text is evaluated, and then the named variable
  2585. or macro's value is set to the evaluated text.  This differs from DEFINE,
  2586. which does not evaluate the text, but rather copies it literally.  The
  2587. distinction between ASSIGN and DEFINE doesn't matter unless the text contains
  2588. variable names.  With ASSIGN, the contents of the variable is copied, whereas
  2589. with DEFINE, the name of the variable is copied.
  2590. @end(d4)
  2591. To illustrate the difference between DEFINE and ASSIGN:
  2592. @begin(example)
  2593. def \%a Monday
  2594. def \%b Today is \%a
  2595. assign \%c Today is \%a
  2596. def \%a Tuesday
  2597. echo \%b
  2598. echo \%c
  2599. @end(example)
  2600. The definition of @q<\%b> is "@q<Today is \%a>", so that whenever the value
  2601. of @q<\%a> changes, so does the value of @q<\%b>.  The definition of @q<\%c>,
  2602. however, is fixed as "@q<Today is Monday>", because "@q<Monday>"
  2603. was the value of @q<\%a> at the time that @q<\%c> was assigned.
  2604.  
  2605. A variable can be used in any Kermit command simply by referring to its name:
  2606. @example(echo \%a)
  2607. and variables can be undefined by DEFINEing or ASSIGNing nothing to them,
  2608. for example:
  2609. @example(define \%a)
  2610.  
  2611. You can define variables with long names, too:
  2612. @example(define telephone-number 7654321)
  2613. But you have to refer to them in a special way, @q<\m(>@i<name>@q<)>, e.g.:
  2614. @example<echo \m(telephone-number)>
  2615.  
  2616. A special kind of variable is called an @i<array>.  This is simply a list,
  2617. in which each element has a number.  An array reference looks like
  2618. @q<\&a[>@i<i>@q<]>.  The @q<\&> means this is an array element rather than a
  2619. simple variable, the letter tells which array it is (a, b, c, ..., z), and
  2620. the brackets enclose an @i<index> which tells which member of the array is
  2621. being referred to: 1, 2, 3, etc.  The index can be a number, or it can be a
  2622. variable or function (even another array element) that has a numeric value.
  2623. Array indices must be (or evaluate to) zero or greater.
  2624.  
  2625. Arrays have to be declared before you can use them, so Kermit will know how big
  2626. the array is and can create storage for it.  The command is DECLARE, for
  2627. example:
  2628. @example(DECLARE \&A[100])
  2629. This tells Kermit to create an array called @q<\&a> with 100 elements.  Once
  2630. an array is declared, its elements can be used just like simple variables:
  2631. @example(DEFINE \&A[3] Tuesday)
  2632. An entire array can be destroyed like this:
  2633. @example(DECLARE \&A[0])
  2634. If you refer to an element of an array that is not declared, the reference is
  2635. replaced by the empty string.
  2636.  
  2637. The array @q<\&@@[]> is predeclared.  It contains the command line that the
  2638. Kermit program was invoked with, one word per array element.  The number of
  2639. elements in the array is given in the built-in variable @q<\v(args)>
  2640. (described later).  Example:
  2641. @example<$ @ux[kermit -p e -b 3]>
  2642. Here @q<\&@@[0]> is the Kermit program's file specification, like
  2643. @q</usr/local/bin/kermit>; @q<\&@@[1]> is @q<-p>, @q<\&@@[2]> is @q<e>, and so
  2644. on.
  2645.  
  2646. The simple variables @q<\%a..\%z> and the arrays @q<\&a[]..\&z[]> are all
  2647. @i<global>, which means they can be referenced from anywhere in your script
  2648. program, including from within a TAKE file or macro.
  2649.  
  2650. You can list the names and values of all existing global simple variables with
  2651. the SHOW GLOBALS command, and you can list the names and dimensions of all
  2652. declared arrays with SHOW ARRAYS.
  2653.  
  2654. @subsection(Macros)
  2655.  
  2656. A Kermit macro is a list of one or more Kermit commands that can be referred
  2657. to by a single name.  Like variables, macros are created by the DEFINE
  2658. (or ASSIGN) command:
  2659. @example(define ibm set parity mark, set duplex half, set handsh xon)
  2660. and unlike variables, macros do not have weird-looking names; macro names can
  2661. be ordinary words.
  2662.  
  2663. Once a macro is defined, you can execute all of its commands simply by typing
  2664. the macro's name:
  2665. @example(C-Kermit>@ux[ibm])
  2666.  
  2667. If you have defined a macro that has the same name as one of Kermit's built-in
  2668. commands, you will have to insert the word DO before the name in order to
  2669. execute the macro rather than the built-in command:
  2670. @example(C-Kermit>@ux[do ibm])
  2671. (you can also use the word DO to invoke any macro).
  2672. In these examples, "IBM" and "DO IBM" are the @i<macro invocations>.  If you
  2673. follow a macro invocation by one or more "words" (a word is a sequence of
  2674. characters delimited by spaces, or else at the end of a line), then each of
  2675. these words is assigned to a digit-variable that is accessible to the commands
  2676. within the macro definition.  These trailing "words" are called the @i<macro
  2677. parameters>.  The first parameter is assigned to @q<\%1>, the second to
  2678. @q<\%2>, and so on, up to a maximum of nine.  The variable @q<\%0> contains
  2679. the name of the macro:
  2680. @begin(example)
  2681. define demo echo \%0: \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9
  2682. demo this is a test of macro argument passing
  2683. @end(example)
  2684.  
  2685. Variables that do not have corresponding parameters are undefined (empty).
  2686. The number of arguments passed to the macro is available in the named variable
  2687. \v(argc)@foot(which, for compatibility with MS-DOS Kermit, may also be
  2688. referred to simply as ARGC, but only within IF conditions.)
  2689. Macro parameters are @i<local> to the macro they are passed to.  If macro A
  2690. invokes macro B, macro B gets its own set of parameters, which are separate
  2691. from macro A's, so that macro A still has its own parameters available after
  2692. macro B has completed.  The variables @q<\%0..\%9> may be used as global
  2693. variables at "top level", when no macros are active, by assigning values to
  2694. them in the normal way.  To demonstrate:
  2695. @begin(example)
  2696. define xx echo \%1, yy Sneezy, echo \%1
  2697. define yy echo \%1, zz Grumpy, echo \%1
  2698. define zz echo \%1
  2699. xx Sleepy
  2700. @end(example)
  2701. Try this, and you'll see how the value of @q<\%1> is saved and restored at each
  2702. level.
  2703.  
  2704. Macro parameter words may be grouped into single parameters
  2705. by enclosing them in braces.  Try the following example to see how this works:
  2706. @begin(example)
  2707. define msg echo \%0: \%1
  2708. msg this is another test of macro argument passing
  2709. msg {this is yet another test of macro argument passing}
  2710. @end(example)
  2711. You can have a macro list its arguments on your screen by including the
  2712. command SHOW ARGUMENTS within the macro definition.
  2713.  
  2714. You can list the names and definitions of all existing macros with the SHOW
  2715. MACROS command.  If you include a name, as in "SHOW MACROS FOO", it will list
  2716. the definition(s) of only those macros whose names start with the character(s)
  2717. you have specified.
  2718.  
  2719. If you define a macro named ON_EXIT, it will be executed automatically
  2720. when the Kermit program exits.
  2721.  
  2722. @subsection(Named Variables)
  2723.  
  2724. Built-in named variables are read-only, you cannot change them.  Their names
  2725. are of the form @q<\v(name)>, in which the v can be lower or uppercase, and the
  2726. parentheses are required around the variable name.  If you refer to a named
  2727. variable that does not exist, it will be evaluated as the empty (zero-length)
  2728. string.  C-Kermit's variables are:
  2729. @begin(d84)
  2730. @q<\v(argc)>@\number of arguments passed to currently active macro.
  2731.  
  2732. @q<\v(args)>@\number of arguments passed to the program on the command line.
  2733. The program argument vector is assigned to the array @q<\&@@[]>.
  2734.  
  2735. @q<\v(count)>@\current value of COUNT (loop control via SET COUNT, IF COUNT).
  2736.  
  2737. @q<\v(cpu)>@\CPU hardware type, if known, otherwise "unknown".
  2738.  
  2739. @q<\v(date)>@\current date in @i<dd mmm yyyy> format (e.g. 8 Feb 1990 or 10 Nov
  2740. 1990)
  2741.  
  2742. @q<\v(directory)>@\current device and/or directory.
  2743.  
  2744. @q<\v(filespec)>@\file specification from most recent SEND, MSEND, or GET
  2745. command, or the name of the file most recently received.
  2746.  
  2747. @q<\v(fsize)>@\size of last file transferred.
  2748.  
  2749. @q<\v(home)>@\user's home (login) directory name.
  2750.  
  2751. @q<\v(host)>@\computer hostname.
  2752.  
  2753. @q<\v(input)>@\current INPUT buffer contents.
  2754.  
  2755. @q<\v(line)>@\current communication device or network host.
  2756.  
  2757. @q<\v(ndate)>@\current date in numeric format, e.g. 19901225.
  2758.  
  2759. @q<\v(ntime)>@\current time in seconds since midnight, 0 through 86399.
  2760.  
  2761. @q<\v(platform)>@\name specific machine or environment C-Kermit was built for.
  2762.  
  2763. @q<\v(return)>@\Value of most recent RETURN command.
  2764.  
  2765. @q<\v(speed)>@\Transmission speed of current communication device, if known.
  2766. (A spurious value of 38400 might be reported for pseudoterminals.)
  2767.  
  2768. @q<\v(status)>@\0 if the previous command succeeded, nonzero if it failed.
  2769.  
  2770. @q<\v(system)>@\name of generic operating system C-Kermit was built for,
  2771. such as UNIX or VMS.
  2772.  
  2773. @q<\v(tfsize)>@\total size of all files in the last group of files that
  2774. was transferred.
  2775.  
  2776. @q<\v(time)>@\current time in hh:mm:ss 24-hour clock format (e.g. 13:45:23).
  2777.  
  2778. @q<\v(ttyfd)>@\file descriptor of communication device (UNIX only).
  2779.  
  2780. @q<\v(version)>@\numeric version number of C-Kermit.
  2781. @end(d84)
  2782. You can use these variables in any Kermit command where their values would
  2783. make sense:
  2784. @example<echo It is \v(time) o'clock on \v(date)>
  2785. A @q<\v>-variable's name can be abbreviated, as long as the abbreviation is
  2786. enough to distinguish it from all the other built-in variable names:
  2787. @q<\v(dir)>, @q<\v(ver)>, etc.
  2788.  
  2789. You can get a listing of Kermit's built-in variables and their values with
  2790. the SHOW VARIABLES command.
  2791.  
  2792. @subsection(Built-in Functions)
  2793.  
  2794. Built-in functions are of the form @q<\f>@i<name>(@i<args>).  The F and the
  2795. name can be upper or lower case.  The @i<args> are a comma-separated list of
  2796. arguments.  The function reference is replaced by its value.  For example:
  2797. @begin(example)
  2798. define \%a ABC123XYZ
  2799. define \%b ...\Flower(\%a)...
  2800. @end(example)
  2801. results in a value of @q<...abc123xyz...> for @q<\%b>.
  2802.  
  2803. The names of built-in functions and variables can be abbreviated to their
  2804. minimum unique length, for example @q<\feval(1+1)>, @q<\v(dir)>, etc.
  2805. C-Kermit's functions include string-oriented functions that return a string:
  2806. @begin(d84)
  2807. @q<\Fliteral(>@i<arg>@q<)>@\Copies its argument literally, without any
  2808. evaluation.
  2809.  
  2810. @q<\Fcharacter(>@i<arg>@q<)>@\Returns the single character corresponding to
  2811. its argument, which must be numeric.  For example, @q<\fchar(65)> is 'A',
  2812. @q<\fchar(193)> is A-acute (in the Latin-1).  If you give a negative number or
  2813. a number larger than 255, only the low-order 8 bits are used.
  2814.  
  2815. @q<\Fsubstr(>@i<arg1>@q<,>@i<arg2>@q<,>@q<arg3>@q<)>@\Substring of the string
  2816. @i<arg1> starting at position @i<arg2>, of length @i<arg3>.  @i<arg2> and
  2817. @i<arg3> must be numbers or variables that have numeric values.  Example:
  2818. @example<echo \fsubst(hello there,7,5)>
  2819. extracts the word "there".  The following is equivalent:
  2820. @begin(example)
  2821. define \%a hello there
  2822. define \%b 7
  2823. define \%c 5
  2824. echo \fsubst(\%a,\%b,\%c)
  2825. @end(example)
  2826.  
  2827. @q<\Flower(>@i<arg>@q<)>@\Converts all uppercase letters in its argument to
  2828. lowercase, for example:
  2829. @begin(example)
  2830. define \%a FINE
  2831. echo This is a \flower(\%a Mess).
  2832. @end(example)
  2833. prints "This is a fine mess."
  2834.  
  2835. @q<\Fupper(>@i<arg>@q<)>@\Converts all lowercase letters in its argument to
  2836. uppercase.
  2837.  
  2838. @q<\Freverse(>@i<arg>@q<)>@\Reverses the order of the characters in its
  2839. argument, for example @q<\frev(mupeen)> is @q<neepum>.
  2840.  
  2841. @q<\Frepeat(>@i<arg1>@q<,>@i<arg2>@q<)>@\Repeats the first argument the number
  2842. of times given by the second argument, for example:
  2843. @example<echo +\frep(-+,10)>
  2844. produces @q<+-+-+-+-+-+-+-+-+-+-+>.
  2845.  
  2846. @q<\Flpad(>@i<text>@q<,>@i<n>@q<,>@i<c>@q<)>@\Left-pads the @i<text> out to
  2847. length @i<n> with character @i<c>.  If @i<c> is omitted, blank (space) is used.
  2848.  
  2849. @q<\Frpad(>@i<text>@q<,>@i<n>@q<,>@i<c>@q<)>@\Right-pads the @i<text> out to
  2850. length @i<n> with character @i<c>.  If @i<c> is omitted, blank (space) is used.
  2851.  
  2852. @q<\Fexecute(>@i<macroname> @i<macro-args>@q<)>@\Execute the named macro with
  2853. the given parameters (if any), return the macro's RETURN value if any (see
  2854. RETURN).
  2855.  
  2856. @q<\Fcontents(>@i<variable-name>@q<)>@\Returns the current definition
  2857. (contents) of a variable.  If the definition includes variable names or
  2858. function references, these are copied literally, without evaluation.
  2859.  
  2860. @q<\Fdefinition(>@i<macro-name>@q<)>@\Returns the literal definition of the
  2861. named macro.
  2862. @end(d84)
  2863.  
  2864. Here are the string functions that return a number:
  2865. @begin(d84)
  2866. @q<\Flength(>@i<arg>@q<)>@\Returns the length of the argument string.
  2867.  
  2868. @q<\Findex(>@i<arg1>@q<,>@i<arg2>@q<,>@i<arg3>@q<)>@\Returns the position of
  2869. the first occurrence string @i<arg1> in string @i<arg2>, starting at position
  2870. @i<arg3>.  If @i<arg3> is omitted, then starting at the beginning.
  2871. @end(d84)
  2872.  
  2873. File functions:
  2874. @begin(d84)
  2875. @q<\Ffiles(>@i<filespec>@q<)>@\Returns the number of files that match the
  2876. given file specification, for example @q<\ffiles(ck*.c)>.
  2877.  
  2878. @q<\Fnextfile()>@\Returns the next filename that matches the @q<\Ffiles>()
  2879. file specification.  Use this in a counted loop (see below) after executing 
  2880. @q<\Ffiles()>.
  2881. @end(d84)
  2882.  
  2883. Integer arithmetic functions:
  2884. @begin(d84)
  2885. @q<\Fmax(>@i<arg1>@q<,>@i<arg2>@q<)>@\Returns the maximum of its two numeric
  2886. arguments.
  2887.  
  2888. @q<\Fmin(>@i<arg1>@q<,>@i<arg2>@q<)>@\Returns the minimum of its two numeric
  2889. arguments.
  2890.  
  2891. @q<\Feval(>@i<expression>@q<)>@\Evaluates the given arithmetic expression.
  2892. The operands of the expression can be numeric strings or variables, or
  2893. functions that evaluate to numeric strings.  The precedence is the normal,
  2894. intuitive algebraic (or programming) precedence, and can be altered by the
  2895. use of parentheses, which have higher precedence than any other operator.
  2896. Spaces may be used to separate operators from operands, but they are not
  2897. required.
  2898. @end(d84)
  2899. Table @ref(-arith) shows the types of expressions accepted by @q<\feval()>.
  2900. @begin<table>
  2901. @bar()
  2902. @blankspace(1)
  2903. @case[device,postscript="@begin(example,size -1)",
  2904. else="@begin(example)"]
  2905. Operator  Fix   Precedence   Operation          Example
  2906.  
  2907.  (   )              1         Group             (\%a + 3) * (\%1-5)
  2908.    !      Post      2         Factorial         \%x! - (\%x-2)!
  2909.  
  2910.    ~      Pre       3         Logical NOT       ~\%n
  2911.    -      Pre       3         Negative          -\%n
  2912.  
  2913.    ^      In        4         Raise to power    2^\%p
  2914.  
  2915.    *      In        5         Multiply          \%c * 5
  2916.    /      In        5         Divide            \%c / 5
  2917.    %      In        5         Modulus           \%c % 5
  2918.    &      In        5         Logical AND       \%c & 5
  2919.  
  2920.    +      In        6         Add               \%t + \%u
  2921.    -      In        6         Subtract          27 - \%x
  2922.    |      In        6         Logical OR        \%z | 4
  2923.    #      In        6         Exclusive OR      \%z # 4
  2924.    @@      In        6         Greatest Common   \%z @@ 30
  2925.                   Divisor
  2926. @end(example)
  2927. @caption<\feval() Arithmetic Functions>
  2928. @tag<-arith>
  2929. @bar()
  2930. @end<table>
  2931.  
  2932. You can list the names of Kermit's built-in functions with the SHOW FUNCTIONS
  2933. command.
  2934.  
  2935. Two Kermit commands are also available to perform simple arithmetic on
  2936. variables:
  2937. @begin(d4)
  2938. INCREMENT @i<name> [@i<value>]@\Add @i<value> to the named variable.  If
  2939. @i<value> is omitted, add 1.  If the variable does not have a numeric value,
  2940. this command has no effect.  Examples: @q<inc \%a, incr \%b 10>.
  2941.  
  2942. DECREMENT @i<name> [@i<value>]@\Subtract @i<value> from the named variable.  If
  2943. @i<value> is omitted, subtract 1.  If the variable does not have a numeric
  2944. value, this command has no effect. 
  2945. @end(d4)
  2946.  
  2947. @subsection(Script Programming)
  2948.  
  2949. Kermit's script programming language lets you write procedures, or
  2950. @i<programs>, that can include any Kermit command.  Variables and functions
  2951. can be referenced at practically any point in any command.  Control structures
  2952. are provided for decision making, transfer of control, looping, scoping of
  2953. variables, and so forth.  A script program can be a TAKE file, a macro, or any
  2954. combination of the two.
  2955.  
  2956. The basic idea of a script program is to automate tasks that you would
  2957. normally do "by hand" when interacting with another computer: dialing the
  2958. modem, negotiating through network boxes and front ends, logging in, etc etc.
  2959. You can also write programs to manage local files, or to do anything that you
  2960. could do manually with Kermit.
  2961.  
  2962. To automate interaction with another computer, you need a replacement for the
  2963. CONNECT command.  This comes in two parts, an OUTPUT command that "types" what
  2964. you would type during CONNECT, and an INPUT command that reads the other
  2965. computer's responses, plus a couple related commands:
  2966. @begin(description,leftmargin +4,indent -4)
  2967. OUTPUT @i<text>@\Send the text to the other computer.  The text can be any
  2968. combination of plain ordinary characters, backslash codes, variables, and
  2969. functions.  To send a BREAK signal, include @q<\\B> in the OUTPUT string.
  2970. To send a Long BREAK signal, include @q<\\L> in the OUTPUT string.
  2971.  
  2972. INPUT @i<timeout> @i<text>@\Read responses from the other computer.  Wait up
  2973. to @i<timeout> seconds for the specified text to appear.  If the text appears
  2974. within the timeout interval, the command succeeds immediately.  Otherwise it
  2975. fails.  The @i<text> can contain any combination of ordinary characters,
  2976. backslash codes, variables, and functions.  If you want to include leading
  2977. and/or trailing blanks in the INPUT text, surround it with braces, as in:
  2978. @example<input 10 {login: }>
  2979. INPUT can be interrupted with Ctrl-C, in which case it fails.
  2980.  
  2981. REINPUT @i<timeout> @i<text>@\Searches previous responses from the computer
  2982. for the given text.  The timeout parameter is ignored.  The previous responses
  2983. are stored in the INPUT buffer, which is 256 characters long, and which may
  2984. also be accessed via the @q<\v(input)> variable.
  2985.  
  2986. ECHO [ @i<text> ]@\Display the text on the local screen, followed by a newline.
  2987. The text can contain any combination of backslash codes, variables, functions,
  2988. etc.
  2989.  
  2990. CLEAR@\Clear any as-yet-unread characters from the communication device's
  2991. input buffer.
  2992.  
  2993. PAUSE [ @i<n> ]@\Do nothing for the indicated number of seconds.  If a number
  2994. is not given, pause for 1 second.  If anything is typed on the keyboard during
  2995. the pause interval, "wake up".  PAUSE can be interrupted by typing Ctrl-C (or
  2996. any other character), in which case it fails.
  2997.  
  2998. WAIT [ @i<n> [ { CD, CTS, DSR } ] ]@\Wait up to @i<n> seconds for the
  2999. specified modem signals to appear on the currently selected communication
  3000. device.  If you don't include any modem signal names, WAIT is equivalent to
  3001. PAUSE.  If you include one or more signal names (separated by spaces), Kermit
  3002. will wait for @i<all> of the specified signals to appear.  If they don't
  3003. appear within the alloted time, or if the device does not have modem control,
  3004. then the command will fail.  You may interrupt the WAIT command by typing any
  3005. character at the keyboard, in which case the command will fail.  The command
  3006. will also fail if modem-signal support is not included in C-Kermit for your
  3007. particular operating system version.  The modem signals are: CD (carrier
  3008. detect), CTS (Clear To Send), and DSR (Data Set Ready).
  3009. @end(description)
  3010. Example:
  3011. @begin(example)
  3012. wait 10 cd dsr      ; Wait 5 seconds for CD and DSR.
  3013. if success goto ok  ; Test the result.
  3014. @end(example)
  3015. WAIT can be interrupted by typing Ctrl-C (or any other character), in which
  3016. case it fails.
  3017.  
  3018. The behavior of the INPUT command can be controlled by SET INPUT:
  3019. @begin(description,leftmargin +4,indent -4)
  3020. SET [ INPUT ] CASE {IGNORE, OBSERVE}@\Tells whether alphabetic case matters
  3021. when searching the remote computer's responses for the INPUT text.  This
  3022. setting also affects C-Kermit's other string comparison operations, including
  3023. IF EQUAL, IF LGT, etc (IF command described later).
  3024.  
  3025. SET INPUT ECHO { ON, OFF }@\Tells whether the characters read by the INPUT
  3026. command should be echoed on the screen.
  3027.  
  3028. SET INPUT TIMEOUT-ACTION { PROCEED, QUIT }@\Tells whether the script program
  3029. should continue or stop immediately if an INPUT command fails.
  3030. @end(description)
  3031.  
  3032. At this point Kermit needs a decision making mechanism to tell whether the
  3033. INPUT command succeeded or failed.  This is the IF command.  Note that IF can
  3034. be used after INPUT only if you SET INPUT TIMEOUT PROCEED.
  3035. @begin(description,leftmargin +4,indent -4)
  3036. IF [NOT] @i<condition> @i<command>@\If the @i<condition> is satisfied, execute
  3037. the following Kermit @i<command>.  If the word NOT is included, execute the
  3038. command if the condition is @i<not> satisfied.
  3039. Only one command may be given, and it must appear on the same line as the IF.
  3040. @end(description)
  3041. The IF command supports a wide variety of conditions.  These are:
  3042. @begin(d84)
  3043. IF SUCCESS@\The previous command succeeded.
  3044.  
  3045. IF FAILURE@\The previous command failed.
  3046.  
  3047. IF DEFINED @i<name>@\The named variable or macro is defined.
  3048.  
  3049. IF BACKGROUND@\Kermit is running in the background or with its standard
  3050. input and output redirected.
  3051.  
  3052. IF COUNT@\Subtract one from COUNT, execute the command if the result is
  3053. greater than zero (see SET COUNT).
  3054.  
  3055. IF EXIST @i<filename>@\The named file exists.
  3056.  
  3057. IF NUMERIC @i<variable>@\The variable's value is numeric.
  3058.  
  3059. IF EQUAL @i<s1 s2>@\s1 and s2 (character strings or variables) are equal.
  3060.  
  3061. IF LLT @i<s1 s2>@\s1 is lexically (alphabetically) less than s2.  Use IF NOT
  3062. LGT for less-@|than-@|or-@|equal.
  3063.  
  3064. IF LGT @i<s1 s1>@\s1 is lexically (alphabetically) greater than s2.  Use IF NOT
  3065. LLT for greater-@|than-@|or-@|equal.
  3066.  
  3067. IF = @i<n1 n2>@\n1 and n2 (numbers or variables containing numbers) are equal.
  3068.  
  3069. IF < @i<n1 n2>@\n1 is arithmetically less than n2. Use IF NOT > for
  3070. less-@|than-@|or-@|equal.
  3071.  
  3072. IF > @i<n1 n2>@\n1 is arithmetically greater than n2\n.  Use IF NOT < for
  3073. greater-@|than-@|or-@|equal.
  3074. @end(d84)
  3075. String comparisons in IF EQUAL, IF LGT, and IF LLT treat alphabetic case
  3076. according to SET INPUT CASE {IGNORE, OBSERVE}.  You can also use @q<\fupper()>
  3077. and @q<\flower()> to force caseless comparisons if INPUT CASE is set to
  3078. OBSERVE.
  3079.  
  3080. Arithmetic comparisons work with numeric constants, variables and array
  3081. elements that evaluate to a numeric string, functions that return a numeric
  3082. value, and the special "MS-DOS Kermit compatibility" variables COUNT, VERSION,
  3083. and ARGC, which can only appear in this context.  Numeric strings are
  3084. converted to binary integers before comparison, and may be positive, zero, or
  3085. negative.  Floating point ("real") numbers are not supported.
  3086.  
  3087. The IF command may be followed on the next line by an ELSE command, which is
  3088. executed if the IF condition is not true, and which is not executed if the IF
  3089. condition is true.  Example:
  3090. @begin(example)
  3091. IF < \%x 10 ECHO It's less
  3092. ELSE echo It's not less
  3093. @end(example)
  3094.  
  3095. As in any programming language, it is desirable to be able to go to different
  3096. places in the program based on the decisions made by IF commands.  The command
  3097. for going-to is:
  3098. @begin(description,leftmargin +4,indent -4)
  3099. GOTO @i<label>@\Go to the command which follows the named label.
  3100. @end(description)
  3101. A label is a word beginning with a colon (:) on the left margin.  Example:
  3102. @begin(example)
  3103. IF < \%x 10 goto less
  3104. echo It's not less
  3105. goto fin
  3106. :less
  3107. ECHO It's less
  3108. :fin
  3109. @end(example)
  3110.  
  3111. Several other commands are especially useful in conditional contexts, i.e. as
  3112. objects of IF commands:
  3113. @begin(description,leftmargin +4,indent -4)
  3114. STOP@\Stop executing the current script program (TAKE file or macro) and
  3115. return immediately to C-Kermit prompt level (or, if Kermit was invoked with
  3116. command-line action arguments, exit C-Kermit altogether).
  3117.  
  3118. END [ @i<n> ]@\Go "up" one command level.  Exit the currently executing macro
  3119. or TAKE file, and return to the invoking TAKE file or macro.  Or, if the
  3120. current TAKE file or macro was invoked from @q(C-Kermit>) prompt level, return
  3121. to the prompt.  Or, if Kermit was invoked with command-line action arguments,
  3122. exit C-Kermit.  If a value is given, it is used to set the SUCCESS flag (if
  3123. the value is zero) or the FAILURE flag (if the value is nonzero).
  3124. You can use POP as a synonym for this command.
  3125.  
  3126. RETURN [@i<value>]@\For use within macros.  Just like END, except that a
  3127. return value may be set.  This is for use with the @q<\fexecute()> function,
  3128. which allows you to write user-defined functions.  For example:
  3129. @begin(example)
  3130. def sum if = \%1 1 return 1,-
  3131.   else return \feval(\%1 + \fexecute(sum \feval(\%1 - 1)))
  3132. @end(example)
  3133. This function, called SUM, returns the sum of all the numbers from 1 to
  3134. whatever number (1 or greater) it was called with, for example:
  3135. @example<echo \fexec(sum 5)>
  3136. prints the number 15.  Notice that this function calls itself; C-Kermit
  3137. functions are allowed to do this.
  3138. @end(description)
  3139.  
  3140. Although the object command of an IF or ELSE statement may only be a single
  3141. command, that command is allowed to be a macro invocation or a TAKE command.
  3142. This provides a kind of statement grouping that can be used to avoid a lot of
  3143. confusing GOTOs.  A more flexible kind of statement grouping is available in
  3144. the XIF ("extended IF") command:
  3145. @begin(description,leftmargin +4,indent -4)
  3146. XIF @i<condition> { @i<command-list> } [ ELSE {  @i<command-list> } ]@\
  3147. In this extended form, braces are required to enclose a comma-separated
  3148. list of one or more commands, and the ELSE clause is on the same line as the
  3149. XIF.  Example:
  3150. @case<device,postscript="@begin(example,size -1)",else="@begin(example)">
  3151. xif < \%x 10 {ech Less,def \%m 10} else {ec Not less,def \%m \%x}
  3152. @end(example)
  3153. Here the appropriate message is echoed, depending on the value of @q<\%x>,
  3154. and the minimum of @q<\%x> and 10 is assigned to the variable @q<\%m>.
  3155. Commands like this one can be broken onto multiple lines for clarity, but only
  3156. if you use dash (or backslash) for line continuation:
  3157. @begin(example)
  3158. xif < \%x 10 { -
  3159.     echo Less, -
  3160.     def \%m 10 -
  3161. } else { -
  3162.     echo Not less, -
  3163.     def \%m \%x -
  3164. }
  3165. @end(example)
  3166. @end(description)
  3167. WARNING: RETURN or END statements should not be used
  3168. within an XIF command.
  3169.  
  3170. @subheading(Other Ways of Assigning Values to Variables)
  3171.  
  3172. Sometimes it is desirable for a script program to interact with you as well
  3173. as with the remote computer.  For example, you should not store passwords on
  3174. disk, so you can't write script programs that contain them.  However, you can
  3175. write script programs that prompt you for your password.  This is done using
  3176. the ASK or ASKQ command:
  3177. @begin(description,leftmargin +4,indent -4)
  3178. ASK @i<name> @i<prompt>@\Print the prompt on the screen and wait for you to
  3179. type a line of text (terminated by carriage return), and assign this line of
  3180. text to the named variable (but without the carriage return), for example:
  3181. @begin(example)
  3182. ask \%p Password:
  3183. output \%p\13
  3184. @end(example)
  3185. The prompt may be enclosed in { curly braces } to retain leading and/or
  3186. trailing spaces.
  3187.  
  3188. ASKQ @i<name> @i<prompt>@\Just like ASK, but it "asks quietly".  The
  3189. characters you type do not echo.  Especially useful for passwords.
  3190. @end(description)
  3191.  
  3192. GETOK @i<text>@\Asks a "yes or no" question.  The @i<text> is the question.
  3193. Enclose it in curly braces to preserve leading or trailing spaces.  If the
  3194. user replies "Yes" or "OK" (or any abbreviation of these), the SUCCESS flag
  3195. is set (for IF SUCCESS).  If she replies "N" or "No", the FAILURE flag is
  3196. set.
  3197.  
  3198. Now, with IF, branching, ASK, and so forth, we can add to our login script:
  3199. @case<device,postscript="@begin(example,size -1)",else="@begin(example)">
  3200. @tabclear()@tabdivide(2)
  3201. define error echo Error: \%1, end@\; Error-handling macro.
  3202. set input timeout proceed@\; Don't quit if INPUT fails.
  3203. set input case ignore@\; Alphabetic case doesn't matter.
  3204. set input echo off@\; Don't need to watch.
  3205. output \13@\; Send carriage return (ASCII 13).
  3206. input 5 login:@\; Wait 5 secs for "login:" prompt.
  3207. if fail error {No login prompt}@\; Give up if it doesn't come.
  3208. output myuserid\13@\; Send user ID followed by CR.
  3209. input 5 password:@\; Wait for password prompt.
  3210. if fail error {No password prompt}@\; Give up if it doesn't come.
  3211. ask \%p Password:@\; Prompt user for password
  3212. output \%p\13@\; Send it, followed by CR
  3213. input 30 $\32@\; Wait for system prompt "$ "
  3214. if fail error {No system prompt}@\; Give up if it doesn't come.
  3215. connect@\; Got it, connect.
  3216. @end(example)
  3217.  
  3218. @subheading(Reading and Writing Local Files)
  3219.  
  3220. It is also possible to assign data from local files to variables.  In fact,
  3221. C-Kermit includes an entire input and output system for local files and
  3222. commands:
  3223. @begin(description,leftmargin +4,indent -4)
  3224. OPEN @i<mode> @i<filename>@\
  3225. For use with READ and WRITE commands.  Open the local file in the specified
  3226. mode: READ, WRITE, or APPEND.  !READ and !WRITE mean to read from or write
  3227. to a system command rather than a file.  Examples:
  3228. @begin(example)
  3229. OPEN READ oofa.txt
  3230. OPEN !READ ls ck[uwc].[cwh]
  3231. @end(example)
  3232. The first example reads lines from the file @q<oofa.txt>.  The second reads
  3233. filenames from a UNIX directory listing; this gives you a way to select files
  3234. using your UNIX shell's filename-@|matching metacharacters, which are more
  3235. powerful than Kermit's built-in ones.
  3236.  
  3237. READ @i<name>@\The next line from the current OPEN READ or OPEN !READ file is 
  3238. assigned to the named variable, for example @q<READ \%A>.  If no more lines
  3239. remain in the file, the command fails.
  3240.  
  3241. WRITE @i<name> @i<text>@\
  3242. Writes the given text to the named log or file.  The text text may include
  3243. backslash codes, and is not terminated by a newline unless you include the
  3244. appropriate code.  The name parameter can be any of the following:
  3245. @begin(description,leftmargin +4,indent -4,spread 0)
  3246. DEBUG-LOG
  3247.  
  3248. FILE (the OPEN WRITE, OPEN !WRITE, or OPEN APPEND file).
  3249.  
  3250. PACKET-LOG
  3251.  
  3252. SCREEN (just like ECHO except that WRITE does not supply a line terminator)
  3253.  
  3254. SESSION-LOG
  3255.  
  3256. TRANSACTION-LOG
  3257. @end(description)
  3258.  
  3259. CLOSE @i<name>@\Closes the named file.  A READ or !READ file is closed
  3260. automatically when end-of-file (EOF) is encountered during a READ operation,
  3261. but it does no harm to close it again.  WRITE, !WRITE, and APPEND files must
  3262. be closed explicitly.  Examples: CLOSE READ, CLOSE WRITE.
  3263. @end(description)
  3264. A typical script program for reading and writing files might look like this:
  3265. @begin(example)
  3266. @tabclear@tabdivide(2)
  3267. set take error off@\; So EOF can be handled.
  3268. open read foo@\; Open input file "foo".
  3269. open write bar@\; Open output file "bar".
  3270. def \%c 0@\; Make a line counter.
  3271. :loop@\; Loop to read all lines.
  3272. read \%a@\; Read one line into \%a.
  3273. if fail goto done@\; Catch EOF this way.
  3274. increment \%c@\; Count the line.
  3275. write file \%c. \fupp(\%a)\10@\; Format and write it.
  3276. goto loop@\; Go back and get more.
  3277. :done
  3278. close read@\; Finished,
  3279. close write@\; close the files.
  3280. echo All done.@\; Print a message.
  3281. @end(example)
  3282.  
  3283. The previous example shows a loop, which is a common programming construct.
  3284. It is always desirable to avoid infinite loops.  The READ example does this
  3285. by testing for end of file (EOF) with IF FAILURE.
  3286.  
  3287. @subheading(Counted Loops)
  3288.  
  3289. Kermit also provides for "finite", or counted, loops, in several varieties:
  3290. @begin(description,leftmargin +4,indent -4)
  3291. SET COUNT / IF COUNT@\Here a special variable, COUNT, is set.  The IF COUNT
  3292. command decrements the count variable, and if the result is greater than
  3293. zero, executes the object command:
  3294. @begin(example)
  3295. set count 5
  3296. :loop
  3297. echo \v(count)
  3298. if count goto loop
  3299. else echo Zero!
  3300. @end(example)
  3301.  
  3302. FOR@q< >@i<variable>@q< >@i<iv>@q< >@i<fv>@q< >@i<step>@q< >@~
  3303. {@q< >@i<command>,@q< >@i<command>,@q< ... >}@\
  3304. The FOR loop is controlled by a loop @i<variable> which is assigned
  3305. an initial value (@i<iv>), gets tested against a final value (@i<fv>), and
  3306. gets incremented by a @i<step> value.  If the step value is positive, the
  3307. loop exits when the loop variable is greater than the final value.  If the
  3308. step is negative, the loop exits when the variable becomes less than the final
  3309. value.  Example (cute way to print the 9's times table):
  3310. @begin(example)
  3311. for \%i 0 9 1 { assign \%j \feval(9-\%i), echo \%i\%j }
  3312. @end(example)
  3313. FOR loops can be nested:
  3314. @begin(example)
  3315. for \%i 1 5 1 { for \%j 5 \%i -1 { echo \%i:\%j } }
  3316. @end(example)
  3317.  
  3318. WHILE@q< >@i<condition>@q< >{@q< >@i<command>,@q< >@i<command>,@q< ... >}@\
  3319. The commands are executed as long as the @i<condition> is true.  The
  3320. conditions are the same as for the IF command.  Example:
  3321. @begin(example)
  3322. while not exist foo.bar { sleep 1 }
  3323. @end(example)
  3324. This loop waits until file named @q<foo.bar> appears.
  3325. @end(description)
  3326. FOR and WHILE loops can be nested in any combination.  Both FOR and WHILE
  3327. loops may be exited or continued prematurely using the following commands:
  3328. @begin(description,leftmargin +4,indent -4)
  3329. BREAK@\Exit from the closest enclosing FOR or WHILE loop.
  3330.  
  3331. CONTINUE@\Begin the next iteration (if any) of the closest enclosing FOR or
  3332. WHILE loop immediately.
  3333. @end(description)
  3334.  
  3335. WARNING: RETURN and END commands should not be used in the object commands
  3336. of FOR, WHILE, or XIF.
  3337.  
  3338. Here's a script program example that has nothing to do with data
  3339. communication or file transfer, but which illustrates the control structures
  3340. of the script language, the use of arrays, statement grouping, file i/o, etc:
  3341. @case<device,postscript="@begin(example,size -1)",else="@begin(example)">
  3342. ; Kermit script program to read a file of numbers into an array,
  3343. ; sort the array numerically, and display the sorted result.
  3344. ;
  3345. def \%d 100                   ; Allow up to 100 elements.
  3346. dcl &a[\%d]              ; Declare a 100-element array.
  3347. set take error off            ; To handle EOF on READ.
  3348. open read numbers.dat         ; Open this file for reading.
  3349.  
  3350. ; Read each line into a separate array element
  3351. ;
  3352. echo Reading...
  3353. for \%n 1 \%d 1 { -
  3354.     read \&a[\%n], -
  3355.     if fail break -
  3356. }
  3357. decr \%n                      ; Subtract one for read that failed.
  3358.                               ; Check for too many lines.
  3359. xif > \%n \%d { -
  3360.     echo Too many lines in file, -
  3361.     stop -
  3362. }
  3363. echo Array initialized: \%n elements, sorting...
  3364.  
  3365. ; Sort the array using the (slow) "bubble sort" algorithm.
  3366. ;
  3367. assign \%m \feval(\%n-1)
  3368. for \%i 1 \%m 1 { -
  3369.     for \%j \%i \%n 1 { -
  3370.     xif > \&a[\%i] \&a[\%j] { -
  3371.         assign \%t \&a[\%i], -
  3372.         assign \&a[\%i] \&a[\%j], -
  3373.         assign \&a[\%j] \%t -
  3374.     } -
  3375.     } -
  3376. }
  3377.  
  3378. ; Display the sorted array.
  3379. ;
  3380. echo sorted.
  3381. for \%i 1 \%n 1 { echo \flpad(\%i,3). \flpad(\&a[\%i],5) }
  3382. @end(example)
  3383.  
  3384. @section(The SCRIPT Command)
  3385. @label(-scrcmd)
  3386.  
  3387. The SCRIPT command allows connection and login sequences to be specified in
  3388. a single, cryptic line in the style of the UNIX uucp @q<L.sys> file.
  3389.  
  3390. Syntax: @q(SCRIPT )@i(expect send )[@i(expect send)] . . .
  3391.  
  3392. "expect" has the syntax: @i(expect)[@i(-send-expect)[@i(-send-expect)[...]]]
  3393.  
  3394. The SCRIPT command carries on a "canned dialog" with a remote system, in
  3395. which data is sent according to the remote system's responses.  The typical use
  3396. is for logging in to a remote system automatically.
  3397.  
  3398. A login script is a sequence of the form:
  3399. @example(@i<expect send [expect send] . . .>)
  3400. where @i(expect) is a prompt or message to be issued by the remote site, and
  3401. @i(send) is the string (names, numbers, etc) to return, and expects are
  3402. separated from sends by spaces.  The send may also be the keyword EOT, to send
  3403. Control-D, or BREAK, to send a break signal.  Letters in sends may be prefixed
  3404. by `@q[~]' to send special characters, including:
  3405. @begin(description,leftmargin +8,indent -4,spread 0)
  3406. @q(~b)@\backspace
  3407.  
  3408. @q(~s)@\space
  3409.  
  3410. @q(~q)@\`@q[?]'(trapped by Kermit's command interpreter)
  3411.  
  3412. @q(~n)@\linefeed
  3413.  
  3414. @q(~r)@\carriage return
  3415.  
  3416. @q(~t)@\tab
  3417.  
  3418. @q(~')@\single quote
  3419.  
  3420. @q(~-)@\dash (hyphen)
  3421.  
  3422. @q(~~)@\tilde itself
  3423.  
  3424. @q(~")@\double quote
  3425.  
  3426. @q(~x)@\XON (Control-Q)
  3427.  
  3428. @q(~c)@\don't append a carriage return
  3429.  
  3430. @q(~)@i(o[o[o]])@ @ octal representation of an ASCII character code
  3431.  
  3432. @q(~d)@\delay approx 1/3 second during send
  3433.  
  3434. @q(~w)@i([d[d]])@ @ wait specified interval during expect, then time out
  3435.  
  3436. @q(\\b)@\send a BREAK signal
  3437. @end(description)
  3438. As with some UUCP systems, sent strings are followed by @q(~r) unless they have
  3439. a @q(~c).
  3440.  
  3441. Only the last 7 characters in each expect are matched.  A null @i(expect),
  3442. e.g. @q(~0) or two adjacent dashes, causes a short delay before proceeding
  3443. to the next send sequence.  A null expect always succeeds.
  3444.  
  3445. As with UUCP, if the expect string does not arrive, the script attempt
  3446. fails.  If you expect that a sequence might not arrive, as with UUCP, 
  3447. conditional sequences may be expressed in the form:
  3448. @example(@i<-send-expect[-send-expect[...]]>)
  3449. where dashed sequences are followed as long as previous expects fail.
  3450. Timeouts for expects can be specified using @q(~w); @q(~w) with no
  3451. arguments waits 15 seconds.
  3452.  
  3453. @i(expect-send) transactions can be easily be debugged by logging
  3454. transactions.  This records all exchanges, both expected and actual.
  3455. The script execution will also be logged in the session log, if that is
  3456. activated.
  3457.  
  3458. Note that `@q[\]' characters in login scripts, as in any other C-Kermit
  3459. interactive commands, must be doubled up.  A line may be ended with a
  3460. single `@q[\]' for continuation.
  3461.  
  3462. Example one:
  3463.  
  3464. Using a modem, dial a UNIX host site.  Expect "login" (...gin), and if it
  3465. doesn't come, simply send a null string with a @q(~r).  (Some UNIXes
  3466. require either an EOT or a BREAK instead of the null sequence, depending
  3467. on the particular site's "logger" program.)  After providing user id
  3468. and password, respond "x" to a question-mark prompt, expect the Bourne
  3469. shell "@q($)" prompt (and send return if it doesn't arrive).  Then cd to
  3470. directory kermit, and run the program called "wermit", entering the
  3471. interactive connect state after wermit is loaded.
  3472. @begin(example)
  3473. set modem ventel
  3474. set line /dev/tty77
  3475. set baud 1200
  3476. dial 9&5551212
  3477. script gin:--gin:--gin: smith ssword: mysecret ~q x $--$ \
  3478.  cd~skermit $ wermit
  3479. connect
  3480. @end(example)
  3481. Note that SET LINE is issued @i<after> SET MODEM, but @i<before>
  3482. SET BAUD or other line-@|related parameters.
  3483.  
  3484. Example two:
  3485.  
  3486. @index(TELENET)
  3487. Using a modem, dial the Telenet network.  This network expects three returns
  3488. with slight delays between them.  These are sent following null expects.  The
  3489. single return is here sent as a null string, with a return appended by default.
  3490. Four returns are sent to be safe before looking for the prompt.  Then the
  3491. Telenet id and password are entered.  Then Telenet is instructed to connect to
  3492. a host site (c 12345).  The host has a data switch that asks "which system";
  3493. the script responds "myhost" (if the "which system" prompt doesn't appear, the
  3494. Telenet connect command is reissued).  The script waits for an @qq"@@" prompt
  3495. from the host, then sends the user ID ("joe") and password ("secret"), looks
  3496. for another @qq<@@> prompt, runs Kermit, and in response to the Kermit's prompt
  3497. (which ends in @qq[>]), gives the commands "set parity even" and "server".
  3498. Files are then exchanged.  The commands are in a take file; note the
  3499. continuation of the 'script' command onto several lines using the `@q[\]'
  3500. terminator.
  3501. @begin(example)
  3502. set modem hayes
  3503. set line /dev/acu
  3504. set speed 1200
  3505. set parity mark
  3506. dial 9,5551212
  3507. script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 @@--@@--@@ id~s\
  3508. aa001122 = 002211 @@ c~s12345 ystem-c~s12345-ystem \
  3509. myhost @@ joe~ssecret @@ kermit > set~sparity~seven > server
  3510. send some.stuff
  3511. get some.otherstuff
  3512. bye
  3513. quit
  3514. @end(example)
  3515. Since these commands may be executed totally in the background, they
  3516. can also be scheduled.  A typical shell script, which might be scheduled
  3517. by cron, would be as follows (csh used for this example):
  3518.  
  3519. @begin(example)
  3520. #
  3521. # Keep trying to dial and log onto remote host and exchange
  3522. # files, wait 10 minutes before retrying if it fails.
  3523. cd someplace
  3524. while ( 1 )
  3525.     kermit < ./tonight.cmd >> nightly.log &
  3526.     if ( ! $status ) break
  3527.     sleep 600
  3528. end
  3529. @end(example)
  3530. File @q(tonight.cmd) might have two takes in it, for example, one to take
  3531. a file with the set modem, set line, set baud, dial, and script, and
  3532. a second take of a file with send/get commands for the remote server.
  3533. The last lines of @q(tonight.cmd) should be BYE and QUIT.
  3534.  
  3535. @section(Command Line Operation)
  3536. @label(-cmdlin)
  3537.  
  3538. A subset of Kermit's commands is available using UNIX-style command line
  3539. options, on operating systems that support passing of command-line options
  3540. to programs through the "argv, argc" mechanism.
  3541.  
  3542. The C-Kermit command line syntax mostly conforms to the @ux(Proposed Syntax
  3543. Standards for UNIX System Commands) put forth by Kathy Hemenway and Helene
  3544. Armitage of AT&T Bell Laboratories in @i(UNIX/World), Vol.1, No.3, 1984.  The
  3545. rules that apply are:
  3546. @begin(itemize,spread 0)
  3547. Command names must be between 2 and 9 characters ("kermit" is 6).
  3548.  
  3549. Command names must include lower case letters and digits only.
  3550.  
  3551. An option name is a single character.
  3552.  
  3553. Options are delimited by '@q(-)'.
  3554.  
  3555. Options with no arguments may be grouped (bundled) behind one delimiter.
  3556.  
  3557. Option-arguments cannot be optional.
  3558.  
  3559. Arguments immediately follow options, separated by whitespace.
  3560.  
  3561. The order of options does not matter.
  3562.  
  3563. '@q(-)' preceded and followed by whitespace means standard input.
  3564. @end(itemize)
  3565. A group of bundled options may end with an option that has an argument.
  3566.  
  3567. The following notation is used in command descriptions:
  3568. @begin(d84)
  3569. @i(fn)@\A file specification, possibly containing the "wildcard"
  3570. characters `@q[*]' or `@q[?]' (`@q[*]' matches all character strings, `@q[?]'
  3571. matches any single character).
  3572.  
  3573. @i(fn1)@\A UNIX file specification which may not contain `@q[*]' or `@q[?]'.
  3574.  
  3575. @i(rfn)@\A remote file specification in the remote system's own syntax, which
  3576. may denote a single file or a group of files.
  3577.  
  3578. @i(rfn1)@\A remote file specification which should denote only a single file.
  3579.  
  3580. @i(n)@\A decimal number between 0 and 94.
  3581.  
  3582. @i(c)@\A decimal number between 0 and 127 representing the value of an
  3583. ASCII character.
  3584.  
  3585. @i(cc)@\A decimal number between 0 and 31, or else exactly 127,
  3586. representing the value of an ASCII control character.
  3587.  
  3588. @q([ ])@\Any field in square braces is optional.
  3589.  
  3590. @q({x,y,z})@\Alternatives are listed in curly braces.
  3591. @end(d84)
  3592.  
  3593. C-Kermit command line options may specify any combination of actions and
  3594. settings.  If C-Kermit is invoked with a command line that specifies no
  3595. actions, then it will issue a prompt and begin interactive dialog.  Action
  3596. options specify either protocol transactions or terminal connection.
  3597.  
  3598. An implicit TAKE command is executed upon your C-Kermit initialization file
  3599. when C-Kermit starts up, upon either interactive or command-line invocation.
  3600. This file may contain C-Kermit interactive-mode commands, which are explained
  3601. later.
  3602.  
  3603. In addition, if the first command line argument is the name of an existing
  3604. file, C-Kermit will read that file and execute Kermit interactive-mode
  3605. commands from it, in addition to (and after) your initialization file (if any).
  3606. Example:
  3607. @example<$ @ux[kermit cmdfile -b 3 -p m]>
  3608. In UNIX, this feature allows you to invoke C-Kermit by "running" a C-Kermit
  3609. command file, if its first line is of the form:
  3610. @example<#!/dir/kermit>
  3611. That is, number sign followed by exclamation point, followed by the full file
  3612. specification of the Kermit program.  You must also give this file execute
  3613. permission:
  3614. @example<$ @ux[chmod +x cmdfile]>
  3615. Then you can run this file as if it were a program, and it will feed itself
  3616. to C-Kermit automatically:
  3617. @example[$ @ux<cmdfile>]
  3618. You can even include C-Kermit command line options:
  3619. @example[$ @ux<cmdfile -l /dev/ttyh8 -p e>]
  3620. If you want the shell prompt to return automatically at the end of this file,
  3621. include an EXIT command at the end of it.  Otherwise you will receive the
  3622. C-Kermit prompt when the file is finished.
  3623.  
  3624. Here are C-Kermit's command-line options:
  3625. @begin<d84>
  3626. @q(=)@\Ignore all command-line options that follow (but make them available
  3627. to the user in the array @q<\&@@[]>).
  3628.  
  3629. @q(-Y )@\(uppercase) Do not execute commands from the initialization file.
  3630.  
  3631. @q(-y )@i(fn)@\Read commands from the specified file instead of the normal
  3632. initialization file.
  3633.  
  3634. @q(-C ")@i<command, command, >@q<...">@\Execute the interactive-mode commands
  3635. after the initialization file (if any), the other command-line options (if
  3636. any), and the command or application file (if any).  The command list must be
  3637. enclosed in double quotes.  Example:
  3638. @example(kermit -C "set file type binary, set window 2")
  3639. The commands in this list are assigned to a macro called @q<cl_commands>,
  3640. so you can also execute them later during your session simply by typing the
  3641. name of this macro:
  3642. @example(C-Kermit>@ux[cl_commands])
  3643. The -C option does is not considered an "action" option, even if the command
  3644. list contains action commands, so if there are no other action commands among
  3645. the command-line arguments, the C-Kermit prompt appears after the last command
  3646. in the list is executed.  To defeat this behavior, include EXIT as the last
  3647. command:
  3648. @example(kermit -C "echo \27[2J\27H, exit")
  3649.  
  3650. @q(-S )@\("Stay") This option tells C-Kermit to issue its prompt and enter
  3651. interactive command mode, even if the command-line options included action
  3652. commands.
  3653. @end<d84>
  3654.  
  3655. These are the file-transfer commands:
  3656. @begin<d84>
  3657. @q(-s )@i(fn)@\Send the specified file or files.  If @i(fn) contains
  3658. wildcard (meta) characters, the UNIX shell expands it into a list.  On
  3659. non-UNIX systems, Kermit expands any wildcard characters.  @i(fn)
  3660. may also be a list of files, as in:
  3661. @example<kermit -s ckcmai.c ckuker.h mail.txt>
  3662. If @i(fn) is '@q[-]' then kermit sends from standard input, which may
  3663. come from a file:
  3664. @example(kermit -s - < foo.bar)
  3665. or a parallel process:
  3666. @example(ls -l | grep cmg | kermit -s -)
  3667. You cannot use this mechanism to send
  3668. terminal typein.  If you want to send a file whose actual name is @qq(-)
  3669. you can precede it with a path name, as in
  3670. @example(kermit -s ./-)
  3671.  
  3672. @q(-r)@\Receive a file or files.  Wait passively for files to arrive.
  3673.  
  3674. @q(-k)@\Receive (passively) a file or files, sending them to standard
  3675. output.  This option can be used in several ways:
  3676. @begin(description,leftmargin +4,indent -4)
  3677. @q(kermit -k)@\Displays the incoming files on your screen; to be used only
  3678. in "local mode" (see below).
  3679.  
  3680. @q(kermit -k > )@i(fn1)@\Sends the incoming file or files to the named file,
  3681. @i(fn1).  If more than one file arrives, all are concatenated together
  3682. into the single file @i(fn1).
  3683.  
  3684. @q(kermit -k | command)@\Pipes the incoming data (single or multiple
  3685. files) to the indicated command, as in
  3686. @example'kermit -k | sort > sorted.stuff'
  3687. @end(description)
  3688.  
  3689. @q(-a )@i(fn1)@\If you have specified a file transfer option, you may give
  3690. an alternate name for a single file with the @q(-a) ("as") option.  For
  3691. example,
  3692. @example'kermit -s foo -a bar'
  3693. sends the file @q(foo) telling the receiver that its name is @q(bar).
  3694. If more than one file arrives or is sent, only the first file is
  3695. affected by the @q(-a) option:
  3696. @example'kermit -ra baz'
  3697. stores the first incoming file under the name @q(baz).
  3698.  
  3699. @q(-x)@\Begin server operation.  May be used in either local or remote mode.
  3700. @end(d84)
  3701.  
  3702. Before proceeding, a few words about remote and local operation are
  3703. necessary.  C-Kermit is "local" if it is running on PC or workstation that
  3704. you are using directly, or if it is running on a multiuser system and
  3705. transferring files over an external communication line -- not your job's
  3706. controlling terminal or console.  C-Kermit is remote if it is running on a
  3707. multiuser system and transferring files over its own controlling terminal's
  3708. communication line (normally @q</dev/tty>), connected to your PC or
  3709. workstation.
  3710.  
  3711. If you are running C-Kermit on a PC, it is normally used in local mode, with
  3712. the "back port" designated for file transfer and terminal connection, and the
  3713. keyboard and screen available to control or interrupt the file transfer and to
  3714. display its status.  If you are running C-Kermit on a multiuser (timesharing)
  3715. system, it is in remote mode unless you explicitly point it at an external
  3716. line for file transfer or terminal connection.  The following command 
  3717. determines whether C-Kermit is in local or remote mode:
  3718.  
  3719. @begin(d84)
  3720. @q(-l )@i(dev)@\Line  -- Specify a terminal line to use for file
  3721. transfer and terminal connection, as in:
  3722. @example'kermit -l /dev/ttyi5'
  3723. You can also give an open file descriptor for a serial communication (tty)
  3724. device.
  3725. @end(d84)
  3726.  
  3727. When an external line is being used, you will also need some additional
  3728. options for successful communication with the remote system:
  3729.  
  3730. @begin(d84)
  3731. @q(-b )@i(n)@\Bits per second -- Specify the transmission speed in bits per
  3732. second ("baud rate") for the line given in the @q(-l) option, as in:
  3733. @example'kermit -l /dev/ttyi5 -b 9600'
  3734. This option should always be included with the @q(-l) option, since the
  3735. speed of an external line is not necessarily what you expect.
  3736.  
  3737. @q(-p )@i(x)@\Parity -- e,o,m,s,n (even, odd, mark, space, or none).  If parity
  3738. is other than none, then Kermit's 8th-bit prefixing mechanism will be used for
  3739. transferring 8-bit binary data, provided the opposite Kermit agrees.  The
  3740. default parity is none.
  3741.  
  3742. @q(-t)@\Specifies half duplex, line turnaround with XON as the handshake
  3743. character, used mainly for communicating with IBM mainframes in linemode.
  3744.  
  3745. @q(-m)@i(name)@\Modem type -- hayes, penril, vadic, etc.  For a complete and
  3746. up-to-date list, run C-Kermit interactively and type "set modem ?".  Note:
  3747. name must be given in lowercase, but can be abbreviated, e.g. "hay" for
  3748. "hayes".
  3749. @end(d84)
  3750.  
  3751. If you wish to use a network connection rather than a terminal line for
  3752. communication, use the following options rather -l:
  3753. @begin(d84)
  3754. @q(-j )@i(name)@\Host -- Specify a network host name.  This option is
  3755. currently supported for TCP/IP Telnet connections on Berkeley-based UNIX
  3756. implementations only, and for VAX/VMS when equipped with TGV MultiNet TCP/IP.
  3757. The speed (-b) parameter does not apply to network connections.  The name can
  3758. be an IP host name, an IP host number (containing dots), or either one of
  3759. these followed by a colon and then a TCP service name or number.  It can also
  3760. be just a number, in which case it is assumed to be a file descriptor for
  3761. an open TCP/IP TELNET connection.
  3762.  
  3763. @q(-X )@i(address)@\X.25 address -- Specify an X.25 network address.
  3764.  
  3765. @q(-Z )@i(number)@\X.25 file descriptor -- Specify a file descriptor for an
  3766. X.25 connection that is already open.
  3767. @end(d84)
  3768.  
  3769. The following commands may be used only with a C-Kermit which is in local
  3770. mode.
  3771.  
  3772. @begin(d84)
  3773. @q(-g )@i(rfn)@\Actively request a remote server to send the named file
  3774. or files; @i(rfn) is a file specification in the remote host's own syntax.  If
  3775. @i(fn) happens to contain any special shell characters, like space, '@q(*)',
  3776. '@q([)', '@q(~)', etc, these must be quoted, as in:
  3777. @example'kermit -g x\*.\?'
  3778. or:
  3779. @example'kermit -g "profile exec"'
  3780.  
  3781. @q(-f)@\Send a 'finish' command to a remote server.
  3782.  
  3783. @q(-c)@\Establish a terminal connection over the specified or default
  3784. communication line, before any protocol transaction takes place.
  3785. Get back to the local system by typing the escape character
  3786. (normally Control-Backslash) followed by the letter 'c'.
  3787.  
  3788. @q(-n)@\Like @q(-c), but @i(after) a protocol transaction takes place;
  3789. @q(-c) and @q(-n) may both be used in the same command.  The use of @q(-n)
  3790. and @q(-c) is illustrated below.
  3791. @end(d84)
  3792. If the other Kermit is on a remote system, the @q(-l) and @q(-b) options should
  3793. also be included with the @q(-r), @q(-k), or @q(-s) options.
  3794.  
  3795. Several other command-line options are provided:
  3796. @begin(d84)
  3797. @index(Binary Files)
  3798. @q(-i)@\Specifies that files should be sent or received exactly "as is" with no
  3799. conversions.  This option is necessary for transmitting binary files.  It may
  3800. also be used in UNIX-to-UNIX transfers (it must be given to @i<both> UNIX
  3801. Kermit programs), where it will improve performance by circumventing the normal
  3802. text-file conversions, and will allow mixture of text and binary files in a
  3803. single file group.  But only use it if character-set translation is not needed.
  3804.  
  3805. @q(-w)@\Writeover -- An incoming file should write over any existing file of
  3806. the same name.  Changes the default behavior, which is to back up the existing
  3807. file before creating the new one.
  3808.  
  3809. @q(-e @i<n>)@\Extended packet length -- Specify that C-Kermit is allowed to
  3810. receive packets up to length @i<n>, where @i<n> may be between 10 and some
  3811. large number, like 1000 or 2000, depending on the system.  The default maximum
  3812. length for received packets is 90.  Packets longer than 94 will be used only
  3813. if the other Kermit supports, and agrees to use, the "long packet" protocol
  3814. extension, and if you request them.
  3815.  
  3816. @q(-v @i<n>)@\Window size -- Specify that C-Kermit is allowed to send
  3817. and receive files using a window size of @i<n>.  That is, up to @i<n> packets
  3818. may be sent before acknowledgements are required.  This speeds up transfers
  3819. in most situations, especially long distance network connections.  Default
  3820. window size is 1, maximum is 32.  Sizes greater than 1 work only if the other
  3821. Kermit supports this option.
  3822.  
  3823. @q(-q)@\Quiet -- Suppress screen update during file transfer, for instance
  3824. to allow a file transfer to proceed in the background.
  3825.  
  3826. @q(-z)@\Force foreground mode: even if Kermit thinks it is running in the
  3827. background, this will make it issue its normal prompts and messages.
  3828. Example:
  3829. @example(kermit -z | vt100)
  3830.  
  3831. @q(-d)@\Debug -- Record debugging information in the file @q(debug.log) in 
  3832. the current directory.  Use this option if you believe the program
  3833. is misbehaving, and show the resulting log to your local
  3834. Kermit maintainer.
  3835.  
  3836. @q(-h)@\Help -- Display a brief synopsis of the command line options.
  3837. @end(d84)
  3838. The command line may contain no more than one protocol action option.
  3839.  
  3840. @begin(comment)
  3841. Files are sent with their own names, except that lowercase letters are raised
  3842. to upper, pathnames are stripped off, certain special characters like (`@q[~]')
  3843. and (`@q[#]') are changed to `@q(X)', and if the file name begins with a
  3844. period, an `@q(X)' is inserted before it.  Incoming files are stored under
  3845. their own names except that uppercase letters are lowered, and, if @q(-w) was
  3846. specified, a "generation number" is appended to the name if it has the same
  3847. name as an existing file which would otherwise be overwritten.  If the @q(-a)
  3848. option is included, then the same rules apply to its argument.  The file
  3849. transfer display shows any transformations performed upon filenames.
  3850. @end(comment)
  3851.  
  3852. During transmission, files are encoded as follows:
  3853. @begin(itemize)
  3854. Control characters are converted to prefixed printables.
  3855.  
  3856. Sequences of repeated characters are collapsed via repeat counts, if
  3857. the other Kermit is also capable of repeated-@|character compression.  This
  3858. feature is negotiated automatically.
  3859.  
  3860. If parity is being used on the communication line, data characters with 
  3861. the 8th (parity) bit on are specially prefixed, provided the other Kermit
  3862. is capable of 8th-bit prefixing; if not, 8-bit binary files cannot be
  3863. successfully transferred.  This feature is negotiated if you give the @q(-p)
  3864. option.
  3865.  
  3866. Conversion is done between UNIX newlines and carriage-@|return-@|linefeed 
  3867. sequences unless the @q(-i) option was specified.
  3868. @end(itemize)
  3869.  
  3870. @subheading(Command Line Examples:)
  3871.  
  3872. @exx(kermit -l /dev/ttyi5 -b 1200 -cn -r)
  3873. This command connects you to the system on the other end of @q(ttyi5) at
  3874. 1200 baud, where you presumably log in and run Kermit with a SEND
  3875. command.  After you escape back, C-Kermit waits for a file (or files) to
  3876. arrive.  When the file transfer is completed, you are reconnected to
  3877. the remote system so that you can logout.
  3878.  
  3879. @exx(kermit -l /dev/ttyi4 -b 1800 -cntp m -r -a foo)
  3880. This command is like the preceding one, except the remote system in this
  3881. case uses half duplex communication with mark parity.  The first file
  3882. that arrives is stored under the name @q(foo).
  3883.  
  3884. @exx(kermit -l /dev/ttyi6 -b 9600 -c | tek)
  3885. This example uses Kermit to connect your terminal to the system at the
  3886. other end of @q(ttyi6).  The C-Kermit terminal connection does not
  3887. provide any particular terminal emulation, so C-Kermit's standard i/o is
  3888. piped through a (hypothetical) program called tek, which performs (say)
  3889. Tektronix emulation.
  3890.  
  3891. @exx(kermit -l /dev/ttyi6 -b 9600 -nf)
  3892. This command would be used to shut down a remote server and then connect
  3893. to the remote system, in order to log out or to make further use of it.
  3894. The @q(-n) option is invoked @i(after) @q(-f) (@q[-c] would have been invoked
  3895. before).
  3896.  
  3897. @exx(kermit -l /dev/ttyi6 -b 9600 -qg foo.\* &)
  3898. This command causes C-Kermit to be invoked in the background, getting a group
  3899. of files from a remote server (note the quoting of the `@q[*]' character).  No
  3900. display occurs on the screen, and the keyboard is not sampled for
  3901. interruption commands.  This allows other work to be done while file
  3902. transfers proceed in the background.  UNIX only.
  3903.  
  3904. @exx(kermit -l /dev/ttyi6 -b 9600 -g foo.\* > foo.log < /dev/null &)
  3905. This command is like the previous one, except the file transfer display has
  3906. been redirected to the file @q(foo.log).  Standard input is also redirected, to
  3907. prevent C-Kermit from sampling it for interruption commands.
  3908.  
  3909. @exx(kermit -iwx)
  3910. This command starts up C-Kermit as a server.  Files are transmitted with no
  3911. newline/@|carriage-@|return-@|linefeed conversion; the @q(-i) option is
  3912. necessary for binary file transfer and recommended for UNIX-@|to-@|UNIX
  3913. transfers.  Incoming files that have the same names as existing files are given
  3914. new, unique names.
  3915.  
  3916. @exx(kermit -l /dev/ttyi6 -b 9600)
  3917. This command sets the communication line and speed.  Since no action is
  3918. specified, C-Kermit issues a prompt and enters an interactive dialog with
  3919. you.  Any settings given on the command line remain in force during the
  3920. dialog, unless explicitly changed.
  3921.  
  3922. @exx(kermit)
  3923. This command starts up Kermit interactively with all default settings.
  3924.  
  3925. The next example shows how UNIX Kermit might be used to send an entire
  3926. directory tree from one UNIX system to another, using the tar program as
  3927. Kermit's standard input and output.  On the originating system, in this case
  3928. the remote, type (for instance):@label(-uxtar)
  3929.  
  3930. @exx(tar cf - /usr/fdc | kermit -is - )
  3931. This causes tar to send the directory @q(/usr/fdc) (and all its files and all
  3932. its subdirectories and all their files...) to standard output instead of to a
  3933. tape; kermit receives this as standard input and sends it as a binary file.
  3934. On the receiving system, in this case the local one, type (for instance):
  3935.  
  3936. @exx(kermit -il /dev/ttyi5 -b 9600 -k | tar xf - )
  3937. Kermit receives the tar archive, and sends it via standard output to its own
  3938. copy of tar, which extracts from it a replica of the original directory tree.
  3939.  
  3940. A final example shows how a UNIX compression utility might be used to speed
  3941. up Kermit file transfers:
  3942. @begin(example)
  3943. compress file | kermit -is -     (@i(sender))
  3944. kermit -ik | uncompress          (@i(receiver))
  3945. @end(example)    
  3946.  
  3947. @section(UNIX Specifics)
  3948.  
  3949. @subsection(The UNIX File System)
  3950.  
  3951. Consult your UNIX manual for details about the file system under your version
  3952. of UNIX.  In general, UNIX files have lowercase names, possibly
  3953. containing one or more dots or other special characters.  UNIX directories are
  3954. tree-@|structured.  Directory levels are separated by slash (@qq[/])
  3955. characters.  For example,
  3956. @example(/usr/foo/bar)
  3957. denotes the file @q(bar) in the directory @q(/usr/foo).  Alphabetic case is
  3958. significant in UNIX file and directory names, i.e. @qq<a> is a different file
  3959. (or directory) from @qq<A>.  Wildcard or "meta" characters allow groups of
  3960. files to be specified.  @qq(*) matches any string; @qq(?) matches any single
  3961. character.
  3962.  
  3963. When C-Kermit is invoked with file arguments specified on the UNIX command
  3964. line, the UNIX shell (Bourne Shell, C-Shell, K-Shell, etc) expands the meta
  3965. characters itself, and in this case a wider variety is available.  For example,
  3966. @example(kermit -s ~/ck[uvm]*.{upd,bwr}]) is expanded by the Berkeley C-Shell
  3967. into a list of all the files in the user's home directory (@q[~/]) that start
  3968. with the characters "@q(ck)", followed by a single character @qq(u), @qq(v), or
  3969. @qq(m), followed by zero or more characters, followed by a dot, followed by one
  3970. of the strings @qq(upd) or @qq(bwr).  Internally, the C-Kermit program itself
  3971. expands only the @qq(*) and @qq(?) meta characters.
  3972.  
  3973. UNIX files are linear (sequential) streams of 8-bit bytes.  Text files consist
  3974. of 7-bit ASCII or ISO-646 NRC characters, with the high-@|order bit off (0),
  3975. or in very recent versions of UNIX, of 8-bit characters in an ASCII-based
  3976. international standard character set such as ISO 8859 Latin Alphabet 1.  Text
  3977. file lines are separated by the UNIX newline character, which is linefeed (LF,
  3978. ASCII 10).  This distinguishes UNIX text files from those on most other
  3979. ASCII-based stream file systems, in which lines are separated by a
  3980. carriage-@|return linefeed sequence (CRLF, ASCII 13, followed by linefeed,
  3981. ASCII 10).  Binary files are likely to contain data in the high bits of the
  3982. file bytes, and have no particular line or record structure.
  3983.  
  3984. @subsection<UUCP Lock Files>
  3985.  
  3986. UNIX has no built-in way of obtaining exclusive access to an external
  3987. communication line.  When you issue the 'set line' command to UNIX Kermit, UNIX
  3988. would normally grant you access to the line even if some other process is
  3989. making use of it.  The method adopted by most UNIX systems to handle this
  3990. situation is the "UUCP lock file".  UUCP, the UNIX-@|to-@|UNIX Copy program,
  3991. creates a file in its directory (usually @q(/usr/spool/uucp), but often
  3992. elsewhere) with a name like @q(LCK..)@i(name), where @i(name) is the
  3993. device name, for instance @q(LCK..tty07).
  3994.  
  3995. UNIX Kermit uses UUCP lock files in order to avoid conflicts with UUCP,
  3996. tip, or other programs that follow this convention, including other users
  3997. running Kermit itself.  Whenever you attempt
  3998. to access an external line using the 'set line' command or `@q(-l)' on the
  3999. command line, Kermit looks
  4000. in the UUCP directory for a lock file corresponding to that device.  For
  4001. instance, if you 'set line /dev/ttyi6' then Kermit looks for the file
  4002. @example(/usr/spool/uucp/LCK..ttyi6)
  4003. If it finds this file, it gives you an error message and a directory
  4004. listing of the file so that you can see who is using it, e.g.
  4005. @begin(example)
  4006. -r--r--r--  1 fdc    8 Feb  7 13:02 /usr/spool/uucp/LCK..ttyi6
  4007. @end(example)
  4008. In this case, you would look up user fdc to find out how soon the line
  4009. will become free.
  4010.  
  4011. This convention requires that the uucp directory be publicly readable
  4012. and writable.  If it is not, the program will issue an appropriate warning
  4013. message.
  4014.  
  4015. If no lock file is found, UNIX Kermit will attempt create one, thus preventing
  4016. anyone who subsequently tries to run Kermit, UUCP, cu, tip, or similar
  4017. programs on the same line from gaining access until you release the line.  If
  4018. Kermit could not create the lock file (for instance because the uucp directory
  4019. is write-@|protected), then you will receive an error message.
  4020.  
  4021. Even when the lock directory is writable and readable, the locking mechanism
  4022. depends upon all users using the same name for the same device.  If a device
  4023. has more than one path associated with it, then a lock can be circumvented by
  4024. using an alias.
  4025.  
  4026. When a lock-@|creating program abruptly terminates, e.g. because it crashes or
  4027. is killed via shell command, the lock file remains in the uucp directory,
  4028. spuriously indicating that the line is in use.  If the lock file is owned by
  4029. yourself, you may remove it.  Otherwise, you'll have to get the owner or the
  4030. system manager to remove it, or else wait for a system task to do so; uucp
  4031. supports a function (uuclean) which removes these files after a predetermined
  4032. age -- uucp sites tend to run this function periodically via crontab.
  4033.  
  4034. Locking is not needed, or used, if communications occur over the user's
  4035. login terminal line (normally @q[/dev/tty]).
  4036.  
  4037. @subsection(C-Kermit under Berkeley or System III/V UNIX)
  4038.  
  4039. C-Kermit may be interrupted at command level or during file transfer by typing
  4040. Control-C.  The program will perform its normal exit function, restoring the
  4041. terminal and releasing any lock.  If a protocol transaction was in progress, an
  4042. error packet will be sent to the opposite Kermit so that it can terminate
  4043. cleanly.
  4044.  
  4045. C-Kermit may be invoked in the background ("@q(&)" on shell commmand line).
  4046. If a background process is "killed", the user will have to manually
  4047. remove any lock file and may need to restore the modem.  This is because 
  4048. the kill signal (@q<kill(@i[x],9)>) cannot be trapped by Kermit.
  4049.  
  4050. During execution of a system command ('directory', 'cd', or `@q(!)'), C-Kermit
  4051. can often be returned to command level by typing a single Control-C.  (With
  4052. System III/V, the usual interrupt function (often the DEL key) is replaced by
  4053. Control-C.) 
  4054.  
  4055. Under Berkeley UNIX only: C-Kermit may also be interrupted by @q(^Z) to put the
  4056. process in the background.
  4057.  
  4058. Control-C, Control-Z, and Control-@q(\) lose their normal functions during
  4059. terminal connection and also during file transfer when the controlling tty
  4060. line is being used for packet i/o.
  4061.  
  4062. If you are running C-Kermit in "quiet mode" in the foreground, then
  4063. interrupting the program with a console interrupt like Control-C will not
  4064. restore the terminal to normal conversational operation.  This is because
  4065. the system call to enable console interrupt traps will cause the program to
  4066. block if it's running in the background, and the primary reason for quiet
  4067. mode is to allow the program to run in the background without blocking, so
  4068. that you can do other work in the foreground.
  4069.  
  4070. If C-Kermit is run in the background ("&" on shell commmand line), then
  4071. the interrupt signal (Control-C) (and System III/V quit signal) are
  4072. ignored.  This prevents an interrupt signal intended for a foreground
  4073. job (say a compilation) from being trapped by a background Kermit session.
  4074.  
  4075. @subsection(C-Kermit on the AT&T UNIX PC)
  4076.  
  4077. @index<UNIX PC>
  4078. For UNIX PC owners here are a couple of hints.  The name of the phone line
  4079. devices are @q</dev/ph0> and @q</dev/ph1>. The RS232 serial port is
  4080. @q</dev/tty000>.
  4081.  
  4082. Dialing out with the internal modem:
  4083. @begin(example)
  4084. C-Kermit>@ux<set line /dev/ph0>
  4085. C-Kermit>@ux<set speed 1200>
  4086. C-Kermit>@ux<set modem att7300>
  4087. C-Kermit>@ux<dial (123) 555-1212>
  4088. @end(example)
  4089. Or use @q</dev/ph1> for the second phone line.    Control-C will terminate the
  4090. dialer.  The telephone line must be in the DATA state; C-Kermit will remind
  4091. you of this if it finds the line in VOICE state. 
  4092.  
  4093. Connecting via the RS232C serial port:
  4094. @begin(example)
  4095. $ @ux<kermit>
  4096. C-Kermit>@ux<set line /dev/tty000>
  4097. C-Kermit>@ux<set speed 9600>
  4098.     @i[(start doing work...)]
  4099.     @i[(after exiting C-Kermit you may type:)]
  4100. @end<example>
  4101. C-Kermit automatically handles disabling and enabling logins on the phone
  4102. lines and RS-232 port.
  4103.  
  4104. @section(X.25 Support)
  4105.  
  4106. @index<X.25>
  4107. This section applies only to UNIX C-Kermit on SUN computers that are attached
  4108. to X.25 networks via the SunLink X.25 product.
  4109.  
  4110. To use an X.25 connection:
  4111. @begin<example>
  4112. C-Kermit>@ux[set network x.25]
  4113. C-Kermit>@ux[set host aaaaaaa]
  4114. C-Kermit>@ux[connect]
  4115. @end<example>
  4116. where aaaaaaa is the X.121 address of the host you wish to connect to.  An
  4117. X.121 address is a many-digit number consisting of a 4-digit DNIC (Data
  4118. Network Identification Code) followed by an NTN (Network Terminal Number) up
  4119. to 10 digits in length, or a 3-digit DCC (Data Country Code) followed by
  4120. a country-dependent NN (National Number) up to 11 digits in length.
  4121.  
  4122. The following connect-mode escapes apply to X.25 terminal connections:
  4123.  
  4124. @begin<d4>
  4125. Ctrl-\H@\Hangup - Close the X.25 network connection.
  4126.  
  4127. Ctrl-\I@\Interrupt - Send an X.25 interrupt packet.
  4128.  
  4129. Ctrl-\R@\Reset the X.25 virtual circuit.
  4130. @end<d4>
  4131.  
  4132. The following special commands can be used to control your X.25 connection:
  4133. @begin(d4)
  4134. HANGUP@\Close the X.25 network connection.
  4135.  
  4136. PAD CLEAR@\Clear the X.25 virtual circuit.
  4137.  
  4138. PAD INTERRUPT@\Send an X.25 Interrupt packet.
  4139.  
  4140. PAD RESET@\Reset the X.25 virtual circuit.
  4141.  
  4142. PAD STATUS@\X.25 status request.
  4143.  
  4144. SET PAD BREAK-ACTION @i<n>@\X.3 Parameter 7.  What PAD should do if it
  4145. receives a BREAK signal.  0 = nothing, 1 = send Interrupt packet, 2 = reset,
  4146. 4 = send Indication Of Break PAD message, 8 = escape to PAD, 16 = discard
  4147. output.  Default = 21 (= 16 + 4 + 1).
  4148.  
  4149. SET PAD BREAK-CHARACTER @i<n>@\Default 0.
  4150.  
  4151. SET PAD LINE-DELETE @i<n>@\X.3 Parameter 17.  0-127 = ASCII value of character
  4152. to be used for erasing a line.  Default = 21 (Ctrl-U).
  4153.  
  4154. SET PAD CHARACTER-DELETE @i<n>@\X.3 Parameter 16.  0-127 = ASCII value of
  4155. character to be used for erasing a character.  Default = 8 (Ctrl-H =
  4156. Backspace).
  4157.  
  4158. SET PAD CR-PADDING @i<n>@\X.3 Parameter 9, Padding After Carriage Return (CR).
  4159. 0-255.  Number of padding characters PAD should send to DTE after sending a
  4160. CR.  Default = 0.
  4161.  
  4162. SET PAD DISCARD-OUTPUT { 0, 1 }@\X.3 Parameter 8.  0 = normal data delivery,
  4163. 1 = discard output.  Default = 0.
  4164.  
  4165. SET PAD LINE-DISPLAY @i<n>@\X.3 Parameter 18.  0-127 = ASCII value of
  4166. character to redisplay an edited line.  Default = 18 (Ctrl-R).
  4167.  
  4168. SET PAD ECHO { 0, 1 }@\X.3 Parameter 2.  0 = PAD will not echo, 1 = PAD will
  4169. echo.  Default = 1.
  4170.  
  4171. SET PAD EDITING { 0, 1 }@\X.3 Parameter 15.  0 = No editing, 1 = editing
  4172. allowed.  Default = 1.
  4173.  
  4174. SET PAD ESCAPE { 0, 1 }@\X.3 Parameter 1.  0 = Escape to PAD not possible,
  4175. 1 = Ctrl-P escapes to PAD.
  4176.  
  4177. SET PAD FORWARD @i<n>@\X.3 Parameter 3, Data Forwarding Characters.  0 = none,
  4178. 1 = any alphanumeric, 2 = carriage return, etc.  Default = 2.
  4179.  
  4180. SET PAD LF-PADDING @i<n>@\X.3 Parameter 14. 0-255 padding characters to be
  4181. sent by PAD after linefeed.  Default = 0.
  4182.  
  4183. SET PAD LF-INSERT @i<n>@\X.3 Parameter 13, Linefeed (LF) insertion after
  4184. carriage return (CR).  0 = no LF insertion, 1 = PAD inserts LF after each CR
  4185. sent to DTE, 2 = PAD inserts LF after each CR received from DTE, 4 = PAD
  4186. echoes LF as CRLF.  Default = 0.
  4187.  
  4188. SET PAD LINE-FOLD @i<n>@\X.3 Parameter 10, Line Folding.  0 = none, 1-255 =
  4189. number of graphic characters per line after which to insert folding characters.
  4190. Default = 0.
  4191.  
  4192. SET PAD PAD-FLOW-CONTROL { 0, 1 }@\X.3 Parameter 5.  0 = No flow control by
  4193. PAD, 1 = PAD may send Xon/Xoff flow control to user.  Default = 0.
  4194.  
  4195. SET PAD SERVICE-SIGNALS { 0, 1 }@\X.3 parameter 6, PAD Service and Command
  4196. Signals.  0 = PAD service signals are not sent to DTE, 1 = PAD service signals
  4197. sent.  Default = 1.
  4198.  
  4199. SET PAD TIMEOUT @i<n>@\X.3 Parameter 4, Data forwarding timeout, 0-255
  4200. (twentieths of a second).  Default = 0 (no data forwarding on timeout).
  4201.  
  4202. @begin(comment)
  4203. SET PAD TRANSMISSION-RATE @i<n>@\X.3 Parameter 11 (read-only).  0 = 110 bps,
  4204. 2 = 300 bps, 3 = 1200 bps, 11 = 75/1200 bps, 12 = 2400 bps, 14 = 9600 bps, etc.
  4205. This command doesn't do anything.
  4206. @end(comment)
  4207.  
  4208. SET PAD USER-FLOW-CONTROL { 0, 1 }@\X.3 Parameter 12.  0 = no flow control by
  4209. user, 1 = user device may send Xon/Xoff flow control to PAD.  Default = 0.
  4210.  
  4211. SET X.25 CALL-USER-DATA { ON [ text ], OFF }@\OFF = no call user data,
  4212. ON @i<text> sends the given text during call setup.
  4213.  
  4214. SET X.25 CLOSED-USER-GROUP { OFF, ON @i<n> }@\OFF = no closed user group,
  4215. ON @i<n> specifies the user group number, 0 to 99.  OFF by default.
  4216.  
  4217. SET X.25 REVERSE-CHARGE { OFF, ON }@\OFF = caller pays, ON = callee pays.
  4218. Default is OFF.
  4219. @end(d4)
  4220.  
  4221. @section(C-Kermit under VAX/VMS)
  4222.  
  4223. This section contributed by
  4224. Terry Kennedy, St. Peter's College, Jersey City, NJ, USA.
  4225.  
  4226. @subsection<File Transfer Issues>
  4227.  
  4228. VMS provides a plethora of file formats, most of which have no direct
  4229. equivalent on other operating systems (especially the other operating systems
  4230. that C-Kermit runs under).  Thus, the user is faced with the issue of file
  4231. format conversion.  VMS C-Kermit attempts to make this as painless as possible
  4232. by mapping the various file formats to canonical form on transmission, and by
  4233. creating the simplest file structure upon reception.  Various C-Kermit
  4234. commands may be used to give C-Kermit "hints" about what the user desires.
  4235. Some of these work only when sending files, others only when receiving files.
  4236. First, let's discuss some terms:
  4237.  
  4238. @b<BINARY TRANSFER MODE (SET FILE TYPE BINARY)>
  4239.  
  4240. When sending a file, C-Kermit/VMS reads bytes from the file and sends them
  4241. without any kind of interpretation, translation, or reformatting.  In
  4242. particular, no characters are inserted at record boundaries.
  4243.  
  4244. When receiving files, C-Kermit/VMS collects bytes and writes them to disk at
  4245. intervals.  The file is created as "Fixed" organization, with the record size
  4246. specifed by the user with SET FILE RECORD-LENGTH, or the default value of 512
  4247. if the user does not override it.  For both send and receive operations, the
  4248. RMS attribute "First free byte" is used.  Thus, VMS C-Kermit can operate on
  4249. files where the file size (in bytes) is not an exact multiple of the file
  4250. record size.
  4251.  
  4252. @b<TEXT TRANSFER MODE (SET FILE TYPE TEXT)>
  4253.  
  4254. When sending files, C-Kermit/VMS attempts to convert the file to a form which
  4255. has the proper delimiters for "canonical Kermit protocol" form.  Specifically,
  4256. CR and LF characters are inserted as needed at the end of each record.  This
  4257. is normally an easy task, but is complicated by some VMS file types (such as
  4258. the "Fortran carriage control" type).  On reception, files are created as
  4259. "Sequential variable, carriage return carriage control".  C-Kermit uses a CR
  4260. followed immediately by a LF as a record delimiter.  Lone CR's or LF's are
  4261. written as part of a record if they are present.
  4262.  
  4263. @b<LABELED TRANSFER MODE (SET FILE TYPE LABELED)>
  4264.  
  4265. When in this mode, C-Kermit/VMS gathers information about the file from
  4266. various sources, such as the file's directory entry, ACL's, etc. and transmits
  4267. it as part of the file data. This is called a LABELED FILE. Such files are not
  4268. usable on non-VMS systems, but may be stored on such systems and later
  4269. restored to another (or the same) VAX. An external utility named CKVCVT
  4270. reconstitutes the file as it was, with various options.
  4271.  
  4272. Other systems should treat labeled files as simple files of TYPE BINARY.
  4273.  
  4274. Now, let's discuss the actions of sending or receiving:
  4275.  
  4276. @paragraph<Sending Files from VMS C-Kermit> The requested file is opened and
  4277. the VMS file characteristics are examined.  Files of format "Undefined" or
  4278. "Fixed" are sent as binary files, other formats are sent as text files.
  4279.  
  4280. @b<SET FILE TYPE IMAGE>.  This forces the file to be sent as a stream of
  4281. bytes, regardless of file characteristics, with a file type of binary declared
  4282. in the attribute packet.  This is useful for cases where other applications
  4283. generate file contents with inappropriate file characteristics (for example,
  4284. a stream-LF file which is actually binary data).  This should only be used as
  4285. a last resort, as [normally] RMS inserts bytes in the file for control
  4286. purposes, and these bytes are transmitted (and misinterpreted by the receiving 
  4287. system).
  4288.  
  4289. @b<SET FILE TYPE LABELED> forces the file to be sent in labeled format,
  4290. with C-Kermit reading the file from the disk as in IMAGE mode, and with a
  4291. file type of binary declared in the attribute packet.
  4292.  
  4293. @paragraph<Receiving Files to VMS C-Kermit>
  4294.  
  4295. The characteristics supplied in the file's attribute packet are
  4296. used to determine the desired file type.  If no attribute packet arrives, the
  4297. current SET FILE TYPE setting, TEXT or BINARY, is used.  If the current file
  4298. type is IMAGE, BINARY is used.  SET FILE TYPE UNDEFINED forces the received
  4299. file to be written with RMS RECORD FORMAT UNDEFINED for compatbility with
  4300. some software that uses non-RMS routines for manipulating files.  This option
  4301. should normally not be used, as you will generate files VMS can't do anything
  4302. with.
  4303.  
  4304. If the current FILE TYPE is LABELED, the incoming
  4305. file is handled in LABELED mode if (a) its attribute packet declares its type
  4306. to be binary, OR (b) there is no attribute packet.  If the attribute packet
  4307. says the file type is text, C-Kermit rejects the file. At the present time,
  4308. C-Kermit does not understand received labeled files, and you should use the
  4309. external CKVCVT utility to convert them.
  4310.  
  4311. @subsection<PRACTICAL APPLICATIONS>
  4312.  
  4313. @paragraph<Between a VMS System and a Different System>
  4314.  
  4315. The defaults should function properly, provided that the receiving system
  4316. uses the "stream-of-bytes" philosophy of UNIX.  Extensive testing has been
  4317. done between VMS C-Kermit and UNIX C-Kermit, as well as MS-DOS Kermit.  Other
  4318. systems may require a re-thinking of the transfer strategy, but this author
  4319. [tmk] considers it unlikely.
  4320.  
  4321. @paragraph<Between VMS Systems>
  4322.  
  4323. The goal of the defaults is to produce useful output in the majority of
  4324. cases.  If you need to transfer binary files where record boundaries are
  4325. important and don't occur at fixed intervals (such as .OBJ files), or where
  4326. the file semantics are extensive and not propagated by C-Kermit (such as
  4327. DDIF files, indexed files, or files with extended semantics stored in an
  4328. ACE, such as PCSA file service contents), you have two options.
  4329.  
  4330. @begin<enumerate>
  4331. SET FILE TYPE LABELED.  Give this command to the sending C-Kermit system,
  4332. receive the file on the target VMS system, and extract the contents with
  4333. CKVCVT.
  4334.  
  4335. Encapsulate these files using VMS BACKUP, transfer the BACKUP saveset, and
  4336. then restore it on the target system.  BACKUP produces output files with a
  4337. simple fixed length record structure.  You should specify an explicit record
  4338. size on the BACKUP command line such as:
  4339. @example<BACKUP *.* FILES.BCK/SAVE_SET/RECORD=8192>
  4340. and give the record size to the receiving Kermit with the command SET FILE
  4341. RECORD-LENGTH before sending your saveset.
  4342. @end<enumerate>
  4343.  
  4344. @subsection<Compatibility with Bliss-32 Kermit>
  4345.  
  4346. Testing has shown that the two Kermits make similar assumptions about file
  4347. characteristics.  A variety of files were uploaded from MS-DOS to VMS with
  4348. Bliss-32 Kermit, using a variety of transfer modes, and then returned to
  4349. MS-DOS with C-Kermit and a byte-for-byte comparison was performed.  The
  4350. reverse operation was then tried and tested.  No discrepancies were found.
  4351. Although this does not guarantee 100% compatibility, it is very close.
  4352. Equivalences:
  4353. @begin<example,leftmargin 0,size -1> 
  4354. C-Kermit/VMS                  Bliss Kermit-32
  4355.  
  4356. SET FILE TYPE TEXT            SET FILE TYPE ASCII
  4357. SET FILE TYPE BINARY [FIXED]  SET FILE TYPE BINARY, SET FILE TYPE FIXED
  4358. SET FILE TYPE BIN UNDEF       (none)
  4359. SET FILE TYPE IMAGE           SET FILE TYPE BLOCK
  4360. SET FILE TYPE LABELED         (none)
  4361. @end<example>
  4362.  
  4363. Note: There is no distinction between SET FILE TYPE BINARY and FIXED in
  4364. C-Kermit/VMS, and none is needed.  C-Kermit determines the file type and
  4365. length automatically when sending, and when receiving binary files, creates
  4366. a fixed-format file and marks the true end using the "first free byte"
  4367. mechanism of RMS.  EXCEPT if you have given the command SET FILE TYPE BINARY
  4368. UNDEFINED, in which case the file is stored with the RMS record format of
  4369. UNDEFINED rather than fixed (but in the same format as a fixed file).
  4370.  
  4371. @subsection<Date and Time Attributes>
  4372.  
  4373. The VMS C-Kermit server sends the file's creation date in the attribute packet
  4374. when a file is sent.  When receiving files, if there was valid date/time
  4375. information in the attribute packet, C-Kermit will set the new file's creation
  4376. date/time to the value provided.  The file will be marked as being revised
  4377. once (initial creation), on the current date/time.  This is necessary to
  4378. ensure that the file will be detected as "new" by VMS BACKUP.  You should also
  4379. note that if a file with a creation date in the future (as perceived by VMS)
  4380. is received from a remote Kermit, the system will report "File has creation
  4381. date in the future" to your system management if they use the ANALYZE/DISK
  4382. command before the file's creation date has occured.
  4383.  
  4384. VMS C-Kermit has the command SET FILE COLLISION UPDATE, which can be used to
  4385. reject files when there is a newer file than the incoming one with the same
  4386. name.  If you use this option, be aware that due to system clock skew, you may
  4387. be able to send the file several times in succession before VMS C-kermit
  4388. rejects it as [now] being older than the one on the VAX.
  4389.  
  4390. @subsection<File Size Attributes>
  4391.  
  4392. When sending files, VMS C-Kermit fills in the file size information in the
  4393. attribute packet. Note that the reported sizes may differ from the actual
  4394. size due to insertion of CR/LF characters on transmission.
  4395.  
  4396. For received files, VMS C-Kermit checks checks for sufficient free disk space
  4397. if the remote Kermit supplies file size information. If there isn't enough
  4398. space on the disk, VMS C-Kermit will reject the file. Please note that user
  4399. quotas are not checked. The logic to do so is quite complicated, and would
  4400. lead to VMS C-Kermit rejecting files that could be received. As an example,
  4401. consider a user with EXQUOTA privilege. In general, a file size rejection
  4402. by VMS C-Kermit means the file will not fit; the lack of a rejection does not
  4403. guarantee that the file will fit. Consider a small file being received onto
  4404. an RX50 floppy. If debugging is turned on, the debug output will fill the
  4405. floppy before the file is completely received.
  4406.  
  4407. If the device for the received file is not a disk (for example, the system
  4408. lineprinter) the file is assumed to always fit.
  4409.  
  4410. @subsection<SET FILE TYPE LABELED>
  4411.  
  4412. Labeled files contain various pieces of information needed to reconstruct
  4413. the file. At the moment, this is handled by an external utility known as
  4414. CKVCVT. Some items are always restored and other are not restored unless
  4415. the user explicitly asks for them. File characteristics are always restored.
  4416. The file name is restored (de-truncated). However, the complete directory
  4417. specification is not used to recreate the file unless explicitly requested.
  4418. This means that converted files will normally be restored to your current
  4419. directory. Similarly, file ownership is assigned to you unless you specify
  4420. that the original owner be retained. Note that the two previous options will
  4421. require privileges. The file backup date is normally cleared so that the file
  4422. will be backed up. This action may be overridden.
  4423.  
  4424. File ACE's are normally not restored. This is an all-or-nothing operation,
  4425. as there are many types of ACE's under VMS. The most common usage of an ACE
  4426. is to grant/deny file access to other users. However, various other uses
  4427. exist. Some examples are: RMS Journaling, RMS Statistics, DDIF, and Pathworks.
  4428. Note that ACE's are transported in binary mode, which means that protection
  4429. ACE's may wind up applying to incorrect users if you move files between
  4430. different VMS systems with ACE's enabled. Also, note that you can create ACE's 
  4431. which you cannot see with DIR/FULL unless you have SECURITY privilege.
  4432. However, you should be able to view (but not modify) them with EDIT/ACL. This 
  4433. also means that you will not be able to delete these ACE's without deleting
  4434. the file, which is another reason they are normally not restored.
  4435.  
  4436. RMS Journaling files are a special case. Journaling will not be enabled for
  4437. a received labeled file. A DIR/FULL will show the journaling ACE, which you
  4438. can use to determine the correct journaling paramters if you wish to journal
  4439. the new file. Note that if you restore the file to another disk (even if it
  4440. is on the same system) the journaling information will display incorrectly.
  4441. This is a limit of the DEC RMS Journaling product.
  4442.  
  4443. @subsection<Reporting Problems>
  4444.  
  4445. If you have a file that does not transfer correctly, or that exhibits a
  4446. problem when moved one way with Bliss-32 Kermit and the back with C-Kermit,
  4447. we would be interested in seeing it (especially if it's small 8-).  Please
  4448. make a BACKUP saveset of it under VMS, and send the saveset along to the
  4449. BUGS address (use the command BUG in C-Kermit for up-to-date information).
  4450. Please include any specific information you think would be useful.  As a
  4451. bare minimum, please give the Kermit version number(s), the VMS version, and
  4452. the compiler version (if you re-compiled Kermit).
  4453.  
  4454. @subsection<Sections that need to be added>
  4455.  
  4456. Hints for users and system managers on configuring their VMS system and
  4457. terminal devices for best use with Kermit -- BYTLM quotas, Alt-typahead
  4458. buffers, etc etc.  What are the sysgen options, what SET TERMINAL commands
  4459. (if any) should be used before running C-Kermit, etc...
  4460.  
  4461. @section(C-Kermit under OS/2)
  4462.  
  4463. This section describes special considerations for using C-Kermit under
  4464. OS/2.
  4465.  
  4466. C-Kermit 4E(72) was adapted to OS/2 by Chris Adie of Edinburgh University,
  4467. Scotland, UK.  The OS/2-specific code was adapted to version 5A(179) and parts
  4468. of it were rewritten by Kai Uwe Rommel of the Technical University of Munich,
  4469. Germany.
  4470.  
  4471. C-Kermit is a protected-mode program.  It will not run in the DOS
  4472. compatability environment.  This means that it will continue running
  4473. (eg transferring files) even when it is not the foreground session.
  4474.  
  4475. The OS/2 C-Kermit initialization file is called CKERMIT.INI.
  4476.  
  4477. @i(All numbers in the C-Kermit documentation are decimal unless noted
  4478. otherwise.)
  4479.  
  4480. @subsection(Requirements)
  4481.  
  4482. C-Kermit will run on a computer with an 80286 or 80386 processor running
  4483. OS/2 version 1.0 or higher.  It runs in character mode - in other words it
  4484. is not a Presentation Manager application.  However, it will run in a
  4485. Presentation Manager window as a character application.  Normally, though,
  4486. you would run it from the command processor (CMD.EXE) prompt.
  4487.  
  4488. @subsection(The Serial Port)
  4489.  
  4490. Naturally, a serial port (COM1 through COM4) is required. The OS/2
  4491. serial port device driver must be loaded using a line like one of
  4492. the following in the CONFIG.SYS file:
  4493.  
  4494. @begin(example)
  4495. @tabset(2 inches)
  4496. @\DEVICE=COM01.SYS
  4497. @i(or)@\DEVICE=COM02.SYS
  4498. @i(or)@\DEVICE=COM.SYS
  4499. @end(example)
  4500.  
  4501. COM01.SYS is used for PC/AT - type machines, while for PS/2s COM02.SYS
  4502. must be used. C-Kermit @i'will not work' if this device driver is not
  4503. loaded. (It provides the Category 1 IOCTLs which are used extensively
  4504. within the program.) COM01.SYS and COM02.SYS are used for version 1.x of
  4505. OS/2 only. For the version 2.0 of OS/2 (soon to be released), only one
  4506. driver COM.SYS exists for both types of machines.
  4507.  
  4508. The connecting cable and the modem (or other computer, PAD etc to which
  4509. your computer is connected) must satisfy the requirements of your
  4510. computer's RS232 interface.  In particular, the computer will provide
  4511. two output control signals (RTS and DTR), and may expect to see signals
  4512. on four input lines (DCD, DSR, CTS, RI).  The precise behaviour of these
  4513. lines is software configurable (for instance by using the OS/2
  4514. '@q(MODE)' command), and C-Kermit makes no attempt to impose a
  4515. particular method of using them.
  4516.  
  4517. By default, the DTR and RTS line will both go ON when C-Kermit opens the
  4518. comms port, and they will go OFF when it is closed.
  4519.  
  4520. The default behaviour for the input lines is that DSR and CTS must be ON
  4521. to enable the port to work.  If the modem you are connected to does not
  4522. provide these signals, you can 'loop back' the RTS output signal from
  4523. the computer to DSR and CTS, using a suitably modified cable.  An alternative
  4524. is to use the MODE command to disable the DSR and CTS inputs.  To do this,
  4525. type a command similar to the following at the OS/2 CMD prompt:
  4526. @begin(example)
  4527. MODE COM1:9600,N,8,1,OCTS=OFF,ODSR=OFF,IDSR=OFF
  4528. @end(example)
  4529. You can check the effect using:
  4530. @begin(example)
  4531. MODE COM1
  4532. @end(example)
  4533. which reports the current settings of COM1.  Note that on some machines,
  4534. C-Kermit may appear to work even although DSR and CTS are not connected
  4535. to anything, nor disabled using '@q(MODE)'.  This is because unconnected
  4536. input lines tend to 'float high'.  Although this situation may not cause
  4537. any problems, it is not good practice - you should explicitly disable
  4538. the inputs as above.
  4539.  
  4540. The '@q(MODE)' utility also allows you to change the baud rate, parity,
  4541. number of data bits and number of stop bits.  C-Kermit provides
  4542. facilities for changing the baud rate and parity too (see later in this
  4543. manual), but when it starts up, it resets the parity to none and the
  4544. number of data bits to 8.  Any changes to baud rate and parity will
  4545. remain in effect after C-Kermit terminates.
  4546.  
  4547. If you change the parity within C-Kermit, it will ajust the number of data
  4548. bits to cope.  There is no way of changing the number of stop bits within
  4549. C-Kermit: use '@q(MODE)' to do this.
  4550.  
  4551. There is also no way to change the hardware flow control settings from
  4552. within C-Kermit. There are too many possible settings for the OS/2
  4553. serial driver to duplicate all '@q(MODE)' options into C-Kermit. You
  4554. can use '@q(MODE)' to adjust the hardware flow control and the settings
  4555. are used by C-Kermit without modification. You can, however, change the
  4556. software flow control from within C-Kermit.
  4557.  
  4558. @subsection(Emergency Exit)
  4559.  
  4560. @i(EMERGENCY EXIT:)@index<Emergency Exit>
  4561. The Control-C and Control-Break keys cannot be used to terminate C-Kermit.
  4562. To terminate C-Kermit unconditionally, you can select it in the task list
  4563. and choose 'Terminate' (OS/2 1.x) or select it in the window list and
  4564. choose the 'Close' option from the menu (OS/2 2.0).
  4565.  
  4566. C-Kermit returns an exit status of zero, except when a fatal error is
  4567. encountered, when the exit status is set to one.  This can be used in a batch
  4568. file, to take some action depending on whether the operation was successful.
  4569. For instance, suppose the file @q(SEND.CMD) contains the following:
  4570. @begin(example)
  4571. echo Sending %1 out port %2
  4572. kermit -ql COM%2 -b 9600 -s %1
  4573. if ERRORLEVEL 1 goto badend
  4574. echo Transferred succcessfully!
  4575. goto end
  4576. :badend
  4577. echo Transfer problems!
  4578. :end
  4579. @end(example)
  4580. To send a file @q(FOO.BAS), you could type:
  4581. @exx(send foo.bas 2)
  4582. to send it to another computer running Kermit, connected to port COM2. 
  4583. If the transfer completed OK, you would get the message '@q(Transferred
  4584. successfully!)'.
  4585.  
  4586. @subsection(The OS/2 File System)
  4587.  
  4588. The features of the OS/2 file system of greatest interest to Kermit users are
  4589. the form of the file specifications, and the formats of the files themselves.
  4590. Note that the following discussion refers to the MS-DOS compatible file
  4591. system supported by initial versions of OS/2.  Installable file systems
  4592. are not covered here - they are significantly different, and the extent to
  4593. which C-Kermit will work under such file systems is unknown (because no
  4594. installable file system has been released at the time of writing).
  4595.  
  4596. @paragraph(File Specifications)
  4597.  
  4598. OS/2 file specifications are of the form
  4599.  
  4600. @exx(@c[DEVICE@q(:\)PATHNAME@q(\)NAME@q(.)TYPE])
  4601.  
  4602. where @c{DEVICE} stands for a single character identifier (for instance, @q(A) for
  4603. the first floppy disk, @q(C) for the first fixed disk, @q(D) for a RAM disk
  4604. emulator) followed by a colon ('@q(:)'), @c[PATHNAME] is up to 63 characters
  4605. of identifier(s) (up to 8 characters each) surrounded by backslashes
  4606. ('@q(\)'), @c[NAME] is an identifier of up to 8 characters, and @c[TYPE] is an
  4607. identifier of up to 3 characters in length.  Device and pathname may be
  4608. omitted.  The first backslash in the pathname may be omitted if the
  4609. specified path is relative to the current directory.  In the path field,
  4610. '@q(.)' means the current directory, '@q(..)' means the parent directory.
  4611.  
  4612. Note that the name, type and path length restrictions apply to the
  4613. original FAT file system of OS/2. The HPFS file system added in later
  4614. revisions does not have such hard restrictions. However, C-Kermit will
  4615. not take much advantage of the long HPFS file names except that it
  4616. recognizes them when sending/receiving files.
  4617.  
  4618. The device and directory specification is normally omitted, but can be
  4619. specified in all C-Kermit commands.  Device and directory pathnames, when
  4620. omitted, default to either the user's current disk and directory, or to the
  4621. current directory search path as specified in the PATH environment variable,
  4622. depending on the context in which the file name appears.
  4623.  
  4624. The C-Kermit command line parser treats backslash characters specially
  4625. and thus requires you either to enter two backslashs when you want to
  4626. enter one in a file specification or to enter a forward slash instead.
  4627. The following two commands are equivalent.
  4628. @begin(example)
  4629. C-Kermit>@ux[send c:\\autoexec.bat]
  4630. C-Kermit>@ux[send c:/autoexec.bat]
  4631. @end(example)
  4632.  
  4633. @i[NAME.TYPE] is sufficient to specify a file on the current disk and
  4634. directory, and only this information is sent along by C-Kermit with an
  4635. outgoing file (by default).
  4636.  
  4637. The device, path, name, and type fields may contain uppercase letters,
  4638. digits, and the special characters '@q[-]' (dash), '@q[_]' (underscore),
  4639. '@q[$]' (dollar sign), '@q[&]' (ampersand), '@q[#]' (number sign),
  4640. '@q[@@]' (at sign), '@q[!]' (exclamation mark), '@q[']' (single quote),
  4641. '@q[()]' (parentheses), '@q[{}]' (curly braces), '@q[^]' (caret or
  4642. circumflex), '@q[~]' (tilde), and '@q[`]' (accent grave).  Normally, you
  4643. should confine your filenames to letters and digits for maximum
  4644. transportability to non-OS/2 systems (by default, C-Kermit will
  4645. translate filenames being sent by converting non-alphanumeric characters
  4646. to '@q(X)').  When you type lowercase letters in filenames, they are
  4647. converted automatically to uppercase.  There are no imbedded or trailing
  4648. spaces.  Other characters may not be included; there is no mechanism for
  4649. "quoting" otherwise illegal characters in filenames.  The fields of the
  4650. file specification are set off from one another by the punctuation
  4651. indicated above (ie colon, backslash and dot).
  4652.  
  4653. The name field is the primary identifier for the file.  The type, also
  4654. called the extension or suffix, is an indicator which, by convention,
  4655. tells what kind of file we have.  For instance @q[FOO.BAS] is the source of
  4656. a BASIC program named FOO; @q[FOO.OBJ] might be the relocatable object
  4657. module produced by compiling @q[FOO.BAS]; @q[FOO.EXE] could be an executable
  4658. program produced by loading @q[FOO.OBJ], and so forth.  @q[.EXE] is
  4659. the normal suffix for executable programs.
  4660.  
  4661. OS/2 allows a group of files to be specified in a single file
  4662. specification by including the special "wildcard" characters, '@q[*]' and
  4663. '@q[?]'.  A '@q[*]' matches any string of characters from the current position
  4664. to the end of the field, including no characters at all; a '@q[?]' matches
  4665. any single character.  Here are some examples:
  4666. @begin(description)
  4667. @tabclear()@tabset(1.5 inches)
  4668. @q[*.BAS]@\All files of type BAS (BASIC source files) in the current directory.
  4669.  
  4670. @q[FOO.*]@\Files of all types with name FOO.
  4671.  
  4672. @q[F*.*]@\All files whose names start with F.
  4673.  
  4674. @q[*.?]@\All files with types exactly one character long, or with no type at all.
  4675. @end(description)
  4676. Wildcard  notation  is used on many computer systems in similar ways, and it is
  4677. the mechanism most commonly used to instruct Kermit to send a group of files.
  4678.  
  4679. You should bear in mind that other (non-OS/2) systems may use different
  4680. wildcard characters.  For instance VMS and the DEC-20 use '@q[%]' instead of
  4681. '@q[?]' as the single character wildcard; when using C-Kermit to request a
  4682. wildcard file group from a Kermit-20 server, the OS/2 '@q[?]' must be
  4683. replaced by the DEC-20 '@q[%]'.
  4684.  
  4685. @paragraph(File Formats)
  4686.  
  4687. OS/2 systems store files as streams of 8-bit bytes, with no particular
  4688. distinction among text, program code, and binary files.  ASCII text
  4689. files consist of lines separated by carriage-return-linefeed sequences
  4690. (CRLFs), and this conforms exactly to the way Kermit represents text
  4691. files during transmission.
  4692.  
  4693. OS/2 (unlike CP/M) knows the exact end of a file because it keeps a byte
  4694. count in the directory, so one would expect no particular confusion in
  4695. this regard. However, certain MS-DOS and OS/2 programs continue to use
  4696. the CP/M convention of terminating a text file with a Control-Z
  4697. character. This may cause problems when the file is transferred
  4698. elsewhere, since other systems may object to the Control-Z. By default,
  4699. therefore, C-Kermit treats the first Control-Z it finds in the file as
  4700. being equivalent to end-of-file. The Control-Z is not transmitted to the
  4701. other system. Of course, this leads to problems when transferring
  4702. non-text files, when we @i(do) want any Control-Zs in the file to be
  4703. sent. To achieve this, the C-Kermit '@q(set file type binary)' command
  4704. may be used. The opposite, '@q(set file type text)', is the default.
  4705.  
  4706. @subsection(Terminal Emulation)
  4707.  
  4708. The CONNECT-mode escape character is Ctrl-] (Ctrl-Rightbracket) by default,
  4709. but you can change it to any other control character with the SET ESCAPE
  4710. command.
  4711.  
  4712. In connect mode, C-Kermit emulates a DEC VT102 terminal.  See the section
  4713. "Terminal Emulation" for details of how the emulation works.
  4714.  
  4715. In CONNECT mode, keyboard input is obtained through the KBD
  4716. subsystem, and screen output is through the VIO subsystem. It is
  4717. therefore impossible to redirect terminal I/O.
  4718.  
  4719. When you issue a '@q(connect)' command the first time after starting Kermit,
  4720. the screen clears and the cursor is positioned at the top left-hand
  4721. corner.  You can log into the remote host computer as normal.  In this
  4722. mode, the PC emulates a DEC VT102 terminal, so any control codes or escape
  4723. sequences received from the host will be actioned appropriately.
  4724.  
  4725. The 25th line on the screen is used as a status line,
  4726. giving the name of the communications port, the current transmission speed,
  4727. and how to obtain help.
  4728.  
  4729. Some keys on the VT102 keyboard have no direct equivalent on the PC
  4730. keyboard.  The following table shows the mapping which obtains between
  4731. VT102 keys and PC keys.  Note that the @q(Alt) @i(n) combinations use
  4732. the number keys along the top row of the keyboard, not the numeric
  4733. keypad.
  4734.  
  4735. @begin(verbatim,need 22)
  4736. @tabclear @tabset(2 inches)
  4737. @ux(VT102)@\@ux(IBMPC)
  4738.  
  4739. Delete@\Del
  4740. PF1@\F1
  4741. PF2@\F2
  4742. PF3@\F3
  4743. PF4@\F4
  4744. Keypad 0@\Alt 0
  4745. Keypad 1@\Alt 1
  4746. Keypad 2@\Alt 2
  4747. Keypad 3@\Alt 3
  4748. Keypad 4@\Alt 4
  4749. Keypad 5@\Alt 5
  4750. Keypad 6@\Alt 6
  4751. Keypad 7@\Alt 7
  4752. Keypad 8@\Alt 8
  4753. Keypad 9@\Alt 9
  4754. Keypad minus@\F5 or F6
  4755. Keypad comma@\F7 or F8
  4756. Keypad dot@\F9
  4757. Keypad enter@\F10
  4758. No Scroll@\Scroll-Lock
  4759. @end(verbatim)
  4760.  
  4761. The PC's '@q(Scroll-Lock)' key (equivalent to the VT102 '@q(No Scroll)'
  4762. key) freezes the data on the screen. It is typically used when listing a
  4763. long file, to prevent information being scrolled off the top of the
  4764. screen. Note that the Control-S and Control-Q (Xon/Xoff) keys should not
  4765. be used for this purpose if '@q(flow)' is set to '@q(xon/xoff)', because
  4766. they interfere with the correct operation of the comms device driver
  4767. flow control. When the '@q(Scroll-Lock)' key is pressed, an '@q(xoff)'
  4768. will be sent automatically when the device driver's receive buffer fills
  4769. up, and an '@q(xon)' will be sent as it empties after the
  4770. '@q(Scroll-Lock)' key has been pressed a second time to unfreeze the
  4771. screen. All other keys are ignored when the screen is frozen. The status
  4772. line indicates when the emulator is in this state.
  4773.  
  4774. Information which scrolls off the top of the screen is not in fact lost,
  4775. but is stored in an "extended display buffer", which can be examined by
  4776. pressing the '@q(PgUp)' key. The extended display buffer can contain a
  4777. number of screenfulls of data, and the '@q(PgUp)' and '@q(PgDn)' keys
  4778. can be used to range freely through this data. If any other key is
  4779. pressed while the extended display buffer is visible, the current screen
  4780. contents are redisplayed and the keystroke is sent to the host. The
  4781. '@q(PgUp)' and '@q(PgDn)' keys may be used even when the host is still
  4782. sending data. If Xon/Xoff flow control is in effect, no data will be
  4783. lost.
  4784.  
  4785. The following VT102 features are not implemented:
  4786. @begin(itemize)
  4787. Smooth scrolling
  4788.  
  4789. 132-column mode
  4790.  
  4791. Alternate character ROM
  4792.  
  4793. LED lamps
  4794. @end(itemize)
  4795.  
  4796. The VT102 keyboard autorepeat mode is always enabled.
  4797.  
  4798. When in connect mode, typing the escape character (Control-@q(])) followed by
  4799. a @q<?> for help will display a "pop-up" help window, indicating the options
  4800. available.  If @q(^]c) is typed to close the connection, the screen is restored
  4801. to its state when the '@q(connect)' command was issued.  A subsequent
  4802. '@q(connect)' will re-display the VT102 screen.
  4803.  
  4804. The control codes and escape sequences recognised by the VT102 emulation
  4805. are listed below.  For full details of the effects of these codes, please
  4806. consult the VT102 manual.
  4807.  
  4808. @begin(example,leftmargin 0)
  4809. @tabclear()@tabset(1.4 inches,2 inches,3inches)
  4810. ENQ@\5@\Send answerback message "OS/2 Kermit"
  4811. BEL@\7@\Sound beep
  4812. BS@\8@\Cursor left
  4813. TAB@\9@\Cursor to next tab stop
  4814. LF@\10@\Cursor down
  4815. VT@\11@\As LF
  4816. FF@\12@\As LF
  4817. CR@\13@\Cursor to left margin
  4818. SO@\14@\Select G1 character set
  4819. SI@\15@\Select G0 character set
  4820. CAN@\24@\Cancel escape sequence
  4821. SUB@\26@\As CAN
  4822. ESC@\26@\See below
  4823. Others@\@\Ignored
  4824.  
  4825. ESC 7@\Save cursor position
  4826. ESC 8@\Restore cursor position
  4827. ESC D@\Index
  4828. ESC E@\Next line
  4829. ESC H@\Set tab at current column
  4830. ESC M@\Reverse index
  4831. ESC Z@\Identify terminal
  4832. ESC c@\Reset
  4833. ESC =@\Enter application keypad mode
  4834. ESC >@\Exit application keypad mode
  4835. ESC # 3@\Double height and width emulation, top half line
  4836. ESC # 4@\Double height and width emulation, bottom half line
  4837. ESC # 5@\Single height and width
  4838. ESC # 6@\Single height and double width emulation
  4839. ESC # 8@\Screen alignment display
  4840. @tabclear()@tabset(2inch,3inch,4inch,5inch)
  4841. ESC ( @i(g)@\G0 designator - @i(g) = A,B or 0 only
  4842. ESC ) @i(g)@\G1 designator - @i(g) = A,B or 0 only
  4843. ESC [ @i(Pn) A@\Cursor up
  4844. ESC [ @i(Pn) B@\Cursor down
  4845. ESC [ @i(Pn) C@\Cursor right
  4846. ESC [ @i(Pn) D@\Cursor left
  4847. ESC [ @i(Pl) ;@i(Pc) H@\Direct cursor address
  4848. ESC [ @i(Pl) ;@i(Pc) f@\Direct cursor address
  4849. ESC [ @i(Pn) c@\Identify report - response is ESC [ ? 6 ; 2 c
  4850. ESC [ 3 g@\Clear all tabs
  4851. ESC [ 0 g@\Clear tabs at current column
  4852. ESC [ ? @i(Pn) h@\Set DEC private mode, shown below
  4853. ESC [ ? @i(Pn) l@\Reset DEC private mode, shown below
  4854.  
  4855.     @ux<mode no.>        @ux<mode>            @ux<set>           @ux<reset>
  4856.  
  4857.         1           Cursor key      Application   Cursor
  4858.         2           ANSI/VT52       N/A           VT52
  4859.         5           Screen          Reverse       Normal
  4860.         6           Origin          Relative      Absolute
  4861.         7           Wraparound      On            Off
  4862.  
  4863. ESC [ @i(Pn) h@\Set mode - modes supported as shown below
  4864. ESC [ @i(Pn) l@\Reset mode - modes supported as shown below
  4865.  
  4866.     @ux<mode no.>        @ux<mode>            @ux<set>           @ux<reset>
  4867.  
  4868.         2           Keyboard lock   On            Off
  4869.         4           Insert          Insert        Replace
  4870.        20           Newline         CR LF         CR
  4871.  
  4872. ESC @i(Pn) i@\Printer/screen on/off - 4 to 7 supported
  4873. ESC [ 5 n@\Status report
  4874. ESC [ 6 n@\Cursor position report
  4875. ESC [ @i(Pn) x@\Request terminal parameter
  4876. ESC [ @i(Pn) ;@i(Pn) r@\Set top and bottom margins
  4877. ESC [ 0 J@\Erase to end of screen
  4878. ESC [ 1 J@\Erase from beginning of screen
  4879. ESC [ 2 J@\Erase all of screen
  4880. ESC [ 0 K@\Erase to end of line
  4881. ESC [ 1 K@\Erase from beginning of line
  4882. ESC [ 2 K@\Erase all of line
  4883. ESC [ @i(Pn) L@\Insert blank lines
  4884. ESC [ @i(Pn) M@\Delete lines
  4885. ESC [ @i(Pn) @@@\Insert blank characters
  4886. ESC [ @i(Pn) P@\Delete characters
  4887. ESC [ @i(Ps) ;@i(Ps) ; ..;@i(Ps) m@ @ @ @ Character attributes or
  4888. ESC [ @i(Ps) ;@i(Ps) ; ..;@i(Ps) }@ @ @ @ Character attributes, as below:
  4889. 0       Default settings
  4890. 1       High intensity
  4891. 4       Underline
  4892. 5       Blink
  4893. 7       Reverse
  4894. 8       Invisible
  4895. 30-37   sets foreground colour to be as shown
  4896.         30      black
  4897.         31      red
  4898.         32      green
  4899.         33      yellow
  4900.         34      blue
  4901.         35      magenta
  4902.         36      cyan
  4903.         37      white
  4904. 40-47   sets background colour to be as shown
  4905.         40      black
  4906.         41      red
  4907.         42      green
  4908.         43      yellow
  4909.         44      blue
  4910.         45      magenta
  4911.         46      cyan
  4912.         47      white
  4913. @end(example)
  4914. Note that the default character set for both G0 and G1 is '@q(A)', ie the UK
  4915. character set.
  4916.  
  4917. The following escape sequences are recognised when the emulator is put into
  4918. VT52 mode by receiving the sequence @q(ESC [ ? 2 l).
  4919.  
  4920. @begin(example,leftmargin 0)
  4921. @tabclear()@tabset(1.4 inches,2 inches,3inches)
  4922. ESC A@\Cursor up
  4923. ESC B@\Cursor down
  4924. ESC C@\Cursor right
  4925. ESC D@\Cursor leftup
  4926. ESC F@\Enter graphics mode
  4927. ESC G@\Exit graphics mode
  4928. ESC H@\Cursor to home
  4929. ESC I@\Reverse line feed
  4930. ESC J@\Erase to end of screen
  4931. ESC K@\Erase to end of line
  4932. ESC Y @i(l c)@\Direct cursor address
  4933. ESC Z@\Identify
  4934. ESC =@\Enter application keypad mode
  4935. ESC >@\Exit application keypad mode
  4936. ESC <@\Enter ANSI mode
  4937. @end(example)
  4938. The escape sequences below are accepted but ignored.
  4939. @begin(example)
  4940. @tabclear()@tabset(1.4 inches,2 inches,3inches)
  4941. ESC O @i(x)@\where @i(x) is any character
  4942. ESC ? @i(x)@\where @i(x) is any character
  4943. ESC [ @i(Pn) q@\Load LEDs
  4944. @end(example)
  4945.  
  4946. @subsection(Keyboard mapping)
  4947.  
  4948. The OS/2 version of C-Kermit provides the same keyboard mapping as the
  4949. UNIX version. A particular key can be mapped to itself (default for all
  4950. keys), to another key (single key stroke) or to a sequence of key strokes
  4951. (a macro text). Use the SET KEY command for this purpose.
  4952.  
  4953. An extension was made to the standard SET KEY command to allow mapping
  4954. of the additional PC keyboard keys. Unlike the UNIX version, the OS/2
  4955. version knows of 768 rather than only 256 keys. The keys 0..255 are the
  4956. usual ASCII and extended ASCII (8-bit PC-specific) characters while all
  4957. extended keys (such as cursor and function keys) in various combinations
  4958. with SHIFT, CONTROL and ALT are known as 256..767 to C-Kermit. To find
  4959. out what the number of some key is, enter the SHOW KEY command and press
  4960. that key. The SHOW KEY command will then report the key number and the
  4961. current assignment.
  4962.  
  4963. Note that a few extended keys have a special meaning to the VT-102
  4964. emulator in CONNECT mode. The cursor keys, for example, send the VT-102
  4965. cursor key escape sequences while Page-Up and Page-Down are used to
  4966. control the emulator's scrollback buffer.
  4967.  
  4968. That means, the CONNECT mode knows a few key numbers and treats them
  4969. specially. If you map another key to the code of one of this special
  4970. known keys, that other key will also function like this special key.
  4971.  
  4972. @subsection(OS/2 C-Kermit Restrictions and Known Bugs)
  4973.  
  4974. @begin(enumerate, spread 1)
  4975. @ux(Server breakout):
  4976. There is no way of stopping server operation from the keyboard, short of
  4977. Control-C.
  4978.  
  4979. @ux(Debugging log):
  4980. There is very little debugging information logged from the OS/2-specific
  4981. parts of the program (it was developed using Codeview).
  4982.  
  4983. @ux(Terminal emulation):
  4984. If the host sends the escape sequence to put the terminal into
  4985. 132-column mode, and subsequently sends data which would appear in the
  4986. rightmost 52 columns, this may mess up the existing data on the screen.
  4987. Really the emulator should ignore any data for these columns.
  4988.  
  4989. @ux(File type):
  4990. The way Control-Z is handled could be better. 
  4991. We need a '@q(set ctrlz {on, off})'
  4992. like MS-DOS Kermit.
  4993.  
  4994. A better display of progress of a transfer is needed.
  4995. @end(enumerate)
  4996.  
  4997. @subsection(Invoking OS/2 C-Kermit from Another Program)
  4998.  
  4999. If you are writing a communications program and wish to incorporate the Kermit
  5000. protocol within it, one way is to use the OS/2 function call @q(DosExecPgm) to
  5001. call up C-Kermit.  You would supply the instructions for Kermit using
  5002. command-line options, and Kermit would do the transfer, returning back to your
  5003. program when it had finished.
  5004.  
  5005. The only problem with this scenario is that you might already have opened up
  5006. the COM port within your program, so that when Kermit tries to do the same it
  5007. gets an error code back from @q(DosOpen).  The @q(-u) command line option
  5008. gets round this problem.  It uses the fact that a child process inherits the
  5009. open file handles of its parent.  @q(-u) takes one numeric parameter which is
  5010. the handle of the COM port in question, and it must occur in front of any other
  5011. command-line parameter which accesses the COM port.  The following is a
  5012. complete C program written using the Microsoft C compiler version 5.1 and the
  5013. Microsoft OS/2 Software Development Toolkit, which illustrates how to use the
  5014. @q(-u) command-line option (NOTE: the UNIX version uses @q(-l) for this).
  5015.  
  5016. @begin(verbatim)
  5017. #define    INCL_BASE
  5018. #include <os2.h>
  5019. /*
  5020.  *    Example of how to use the C-Kermit -u option to invoke
  5021.  *    Kermit from another program under OS/2.
  5022.  */
  5023. main(int argc, char *argv[]) {
  5024. HFILE    ttyfd;
  5025. USHORT    action;
  5026. int    err,i;
  5027. char    failname[80];
  5028. char    args[80];
  5029. RESULTCODES    res;
  5030. struct dcb {            /* Device control block */
  5031.     USHORT write_timeout;
  5032.     USHORT read_timeout;
  5033.     BYTE flags1, flags2, flags3;
  5034.     BYTE error_replacement;
  5035.     BYTE break_replacement;
  5036.     BYTE xon_char;
  5037.     BYTE xoff_char;
  5038. } ttydcb;
  5039.  
  5040.     /*** Open a file ***/
  5041.     if (err=DosOpen(argv[1],&ttyfd,&action,0L,0,1,0x0012,0L)) {
  5042.         printf("Error %d opening %s\n",err,argv[1]);
  5043.         exit(1);
  5044.     }
  5045.     if (err=DosDevIOCtl(&ttydcb,NULL,0x0073,1,ttyfd)) {
  5046.         printf("Error %d from IOCTL on %s\n",err,argv[1]);
  5047.             exit(1);
  5048.     }
  5049.     ttydcb.flags3 &= 0xF9;
  5050.     ttydcb.flags3 |= 0x04;    /* Read "some" data from line */
  5051.     DosDevIOCtl(NULL,&ttydcb,0x0053,1,ttyfd);
  5052.  
  5053.     /*** Call kermit ***/
  5054.     strcpy(args,"ckoker");
  5055.     i = strlen(args);
  5056.     args[i++]=0;
  5057.     sprintf(&args[i],"-u %d -q -s test.c",ttyfd);
  5058.     i += strlen(&args[i]);
  5059.     args[i++]=0;
  5060.     args[i++]=0;
  5061.     if (err=DosExecPgm(failname,80,EXEC_SYNC,args,NULL,&res,
  5062.                             "KERMIT.EXE")) {
  5063.         printf("Error %d executing Kermit\n",err);
  5064.         exit(1);
  5065.     }
  5066.     
  5067.     /*** Print out return code ***/
  5068.     printf("Termination code %d\n",res.codeTerminate);
  5069.     printf("Result code %d\n",res.codeResult);
  5070.  
  5071.     /*** Close the file ***/
  5072.     if (err=DosClose(ttyfd)) {
  5073.         printf("Error %d closing %s\n",err,argv[1]);
  5074.     }
  5075. }
  5076. @end(verbatim)
  5077.  
  5078. @section(C-Kermit on the Commodore Amiga)
  5079.  
  5080. This section written mostly by Jack Rouse and Stephen Walton.
  5081.  
  5082. This version of Amiga Kermit is a port of the UNIX C-Kermit which attempts
  5083. to reproduce as much of the functionality of UNIX version as possible.  I
  5084. had two main goals in porting C-Kermit:  I wanted a reliable remote file
  5085. transfer utility, and I wanted to investigate the use of the AmigaDOS
  5086. and Exec environments.
  5087.  
  5088. Amiga Kermit currently provides a line oriented user interface.
  5089. The DIAL
  5090. and SCRIPT commands are as yet unimplemented.  Therefore, only Amiga
  5091. specific features are noted below.
  5092.  
  5093. @subsection(Invoking C-Kermit)
  5094.  
  5095. Amiga Kermit is usually invoked from a CLI process.  However, you can
  5096. also start it from a Tool type icon, at least for the version of Kermit
  5097. compiled with Manx Aztec C.  Create a Tool icon, called @q<Kermit.info>,
  5098. and make sure that it contains a ToolType entry for WINDOW= followed
  5099. by some window specification.  This is actually a small dummy window,
  5100. as C Kermit will open and use its own window.
  5101.  
  5102. From a CLI window, you generally enter:
  5103. @example(KERMIT)
  5104. or
  5105. @example(RUN KERMIT)
  5106. to execute Kermit and start up the Kermit command interpreter.  Make sure
  5107. you set your stack to at least 10000 with the AmigaDOS Stack command first.
  5108. Kermit will create its own window and greet you with:
  5109. @begin(example)
  5110.    C-Kermit S/W, @value(-ckversion) 8 Feb 92, Commodore Amiga
  5111.    Type ? or 'help' for help
  5112.    C-Kermit>
  5113. @end(example)
  5114.  
  5115. The cursor will appear following the C-Kermit> prompt.  Typing ? will
  5116. produce a list of the items that can be entered at any point.
  5117.  
  5118. Typing ? at various points during command entry will help you navigate
  5119. through the command processor.  The 'help' command is also quite useful.
  5120.  
  5121. The Kermit command processor is normally exited with the 'QUIT' command.
  5122. During Kermit protocol, you can type CTRL-C or CTRL-D to interrupt and
  5123. exit Kermit.  Depending on the version of the C runtime libraries used
  5124. to link Kermit, the interrupt may also be active during command input, but
  5125. it is disabled during connect mode.  You will get a requestor when the
  5126. interrupt is activated to allow you to choose to continue Kermit.  However,
  5127. any serial read or write that was interrupted will still be aborted.
  5128.  
  5129. Kermit can also be used without the command processor by specifying an
  5130. action on the command line.  You can enter 'kermit -h' at the CLI prompt
  5131. to get a list of command line options.  However, unless input is redirected,
  5132. or the -q (quiet) option is specified, Kermit will still create a window
  5133. for protocol monitoring and interruption.  'KERMIT <*' can be used to
  5134. run Kermit completely within the CLI window; however, this does not allow
  5135. you to enter control characters, and no console input is seen until you
  5136. enter return.  Input and output can be redirected to files to take advantage
  5137. of C-Kermit command line file transfer options.  Unfortunately, AmigaDOS
  5138. does not implement pipes (yet).
  5139.  
  5140. @subsection<Kermit Serial Initialization and Settings>
  5141.  
  5142. Amiga Kermit uses the serial device or a reasonable emulation thereof.
  5143. Three sources are used to initialize the serial parameters.  First, the
  5144. default serial configuration, as set by Preferences, is copied.  This
  5145. includes baud rate, and under version 1.2 of the Workbench, parity, modem
  5146. control (7-wire vs. 3-wire), and flow control.  Second, command line
  5147. parameters can be used to override these settings.  For example:
  5148. @example(kermit -b 1200 -p e)
  5149. can be used to select 1200 baud and even parity independently of the
  5150. Preferences settings.  Finally, if the command processor is used, Kermit
  5151. looks for a @q".kermrc" initialization file, first in the @q"s:" directory,
  5152. then in the current directory, providing that the disk containing each
  5153. directory is present in the Amiga.  The @q".kermrc" file contains C-Kermit
  5154. commands which can be used to initialize the C-Kermit environment as desired.
  5155.  
  5156. The Kermit SET LINE command has a special form in Amiga Kermit, namely:
  5157. @example(SET LINE @i<device/unit>)
  5158.  
  5159. where @i"device" is the name of a device (including the @q<.device> extension)
  5160. and @i"unit" is the unit number.  The default setting is equivalent to:
  5161. @example(SET LINE serial.device/0)
  5162.  
  5163. The modem control mode is currently selected by 'SET MODEM type', which
  5164. has two choices: 'DIRECT', for 3-wire control, and 'GENERIC', for 7-wire
  5165. control.  Because of the way the serial device operates, this setting only
  5166. has an effect when the serial device is opened after previously being
  5167. closed, which occurs only when the serial line is used after Kermit starts
  5168. or after '<escape>H' is used to hang up and exit connect mode.
  5169.  
  5170. Kermit allows you to set any baud rate between 110 and 292000 baud;
  5171. however, it will complain if the baud rate is nonstandard.  Rates of
  5172. 110 and 111 baud are implemented as 112 baud.  Rates above 38400 baud can
  5173. be used for connect mode, but they are not very useful for file transfer.
  5174. The file transfer rate is limited by packet retries due to transfer
  5175. errors, and the overhead time spent constructing packets.
  5176.  
  5177. Amiga Kermit uses the serial device in shared mode.  This allows other
  5178. programs, like dialers, to use the serial line at the same time, without
  5179. exiting Kermit.  This could also allow in theory a terminal emulator to be
  5180. used simultaneously with Kermit.  However, if two programs are reading from
  5181. the serial line at the same time, the results are unpredictable.  Any such
  5182. program, therefore, would have to be disabled from reading while Kermit is
  5183. performing file transfer or is in connect mode.  Note that Kermit since does
  5184. its own parity generation and stripping, so it always sets the serial device
  5185. to use eight bit characters with no parity.
  5186.  
  5187. @subsection<Amiga Wildcards>
  5188.  
  5189. Both the SEND command invoked from the Amiga and a GET sent to an Amiga
  5190. in server mode use allow wildcarding, in the UNIX style.  Thus, '*'
  5191. wildcard matches an arbitrary string while '?' matches an arbitrary
  5192. character.  Therefore, to get all the C source files which begin with 'cki'
  5193. from the Amiga server, you could use the command:
  5194. @begin(example)
  5195.    C-Kermit>@ux[get cki*.c]
  5196. @end(example)
  5197. Multiple '*' wildcards can be used in a pattern.  Remember, the
  5198. wildcarding that is used in local and remote server commands that invoke
  5199. AmigaDOS commands is the AmigaDOS form.
  5200.  
  5201. @subsection(Local and Remote Commands)
  5202.  
  5203. Amiga Kermit provides several ways to invoke AmigaDOS commands from within
  5204. Kermit.  Entering '!' at the Kermit prompt will create a CLI process running
  5205. in its own window, and wait for it to terminate.  The form '! command' will
  5206. invoke the given command command with its output going to Kermit's window.
  5207. There is currently no way to pause the output of commands invoked his way,
  5208. other than the stopgap use of the right mouse button.  The form 'REMOTE
  5209. HOST command' can be sent to the Amiga server to execute the given command
  5210. remotely on the Amiga.  Because of the way AmigaDOS Execute() function
  5211. works, commands invoked in either the '! command' or 'REMOTE HOST command'
  5212. forms have NIL: as their standard input.  Some AmigaDOS commands that
  5213. require input, such as DiskCopy and Format, do not recognize the immediate
  5214. end of file that they receive under this condition, causing them to hang.
  5215.  
  5216. In addition to the methods given above, various AmigaDOS commands are
  5217. invoked by local Kermit commands, and generic remote commands.  These
  5218. are listed below:
  5219. @begin<example,leftmargin 0, above 1>
  5220. @ux<AmigaDOS command>    @ux<Local command>      @ux<Remote generic command>
  5221. DELETE files        --none--           REMOTE DELETE files
  5222. TYPE files          --none--           REMOTE TYPE files
  5223. INFO                SPACE              REMOTE SPACE
  5224. LIST obj            DIRECTORY obj      REMOTE DIRECTORY
  5225. STATUS              --none--           REMOTE WHO
  5226. @end<example>
  5227.  
  5228. Any parameters to these commands are expected to use AmigaDOS conventions,
  5229. including AmigaDOS wildcarding.  Note that in order to pass a '?' through
  5230. the C-Kermit command processor, it must be prefixed with a '\'.
  5231.  
  5232. You can change the current directory of the Kermit process locally with the
  5233. CWD command and remotely with REMOTE CWD.  The local CWD command prints
  5234. out the name of the current directory afterwards.  If no new directory
  5235. is given, the current directory is not changed, so CWD alone can be used
  5236. to determine where the current directory is.
  5237.  
  5238. @subsection<Server Mode>
  5239.  
  5240. Amiga Kermit completely implements server mode, including the ability
  5241. to execute CLI commands remotely.  Currently CLI commands are executed
  5242. with their standard output directed to RAM:PIPE-HOLDER, which is then
  5243. written back to the commanding Kermit after the command completes.
  5244.  
  5245. There are a few limitations on the commands that can be executed remotely.
  5246. First of all, if they produce voluminous output, the output should be
  5247. redirected (redirection is supported on the REMOTE HOST command line)
  5248. to avoid using all free memory for the output file.  However, the
  5249. commanding Kermit will probably timeout in the middle of the execution
  5250. of any such command.  The best way to use these commands is to
  5251. @begin<example>
  5252.    REMOTE HOST RUN command >outfile parameters
  5253. @end<example>
  5254. then use REMOTE WHO (which invokes STATUS) to monitor the command for
  5255. completion.
  5256.  
  5257. The input stream for remote commands is NIL:, which is not handled
  5258. intelligently by all Amiga commands.  For example, 'REMOTE HOST diskcopy
  5259. df0: to df1:' hangs indefinitely while waiting for NIL: to press return.
  5260. Finally, since each command is executed in a separate CLI, commands that
  5261. set unshared process parameters, like 'cd',  will have null effect (but
  5262. 'REMOTE CWD dir' can be used instead).
  5263.  
  5264. While server mode is active, AmigaDOS requestors are disabled.  This
  5265. avoids requiring operator intervention to reset a requestore when the Amiga
  5266. server is told to use a file on a disk that does not exist or is write
  5267. protected.  However, disabled requestors are currently not inherited by the
  5268. CLI processes that the server creates to execute remote commands.
  5269. Therefore, a remote AmigaDOS command can still cause the server to become
  5270. hung.
  5271.  
  5272. To shut down the Amiga server, enter BYE or FINISH at the commanding
  5273. Kermit.  FINISH exits to whatever level the server was invoked from,
  5274. while BYE exits Amiga Kermit altogether.
  5275.  
  5276. @subsection<Connect Mode>
  5277.  
  5278. Connect mode on Amiga Kermit currently provides you with a standard
  5279. AmigaDOS console device window.  Using the default Preferences
  5280. setting, this gives a 23 row by 77 column screen.  However, the
  5281. MoreRows program allows you to increase the size of the Workbench
  5282. window beyond the 640 by 200 default size; increasing the number of
  5283. rows by 8 and the number of columns by 16 will allow a 24 row by 80
  5284. column Kermit window.  The Amiga console device is used to provide
  5285. ANSI terminal emulation.  While you are in connect mode, you can give
  5286. single character commands which are prefixed by an escape character
  5287. which can be set from within C-Kermit.  By default, the escape
  5288. character is CTRL-\.  You can use '<escape>H' to close the serial
  5289. device and exit connect mode, which makes the DTR line drop causing
  5290. most modems to hang up the phone line.
  5291.  
  5292. You can currently get a 25 by 80 screen in Kermit by means of a kludge.
  5293. Entering the Kermit command line (backslashes will be echoed only once):
  5294. @example(ECHO \\033[25t\\033[80u\\033[0x\\033[0y\\014)
  5295. activates console device private escape sequences that cause the console
  5296. to use a 25 by 80 region, overwriting the borders of the Kermit window.
  5297. Using window gadgets will cause the borders to be redisplayed, but the
  5298. display can be cleaned up by typing ctrl-L in command mode.  To reset
  5299. the window to its normal condition, allowing resizing, use:
  5300. @example(ECHO \\033[t\\033[u\\033[x\\033[y\\014)
  5301. and then activate a window gadget to refresh the borders.  These commands
  5302. can be placed into Kermit TAKE files.
  5303.  
  5304. In addition to the standard connect mode commands, extra logging control
  5305. has been added.  If a session log file is open, the '<escape>Q' sequence
  5306. allows you to temporarily suspend logging.  The '<escape>R' sequence
  5307. resumes logging if it has been suspended.
  5308.  
  5309. Features have also been added to prevent deadlocks while in connect mode
  5310. due to spurious XOFF's or bad modem control line states.  When connect
  5311. mode is unable to send serial output, keyboard characters are queued until
  5312. they can be transmitted.  Queuing continues as long as space is available
  5313. in the output buffer.  If the buffer, which is 64 characters long, fills up,
  5314. the next keyboard input is discarded and the display 'beeps'.  To get out
  5315. of a deadlock situation, you can either exit connect mode, or send a break.
  5316. In either case, the output queue is flushed, and current serial output
  5317. character is given one second to finish transmitting.  If it does not
  5318. complete, the output is aborted, and XOFF mode reset as appropriate.  Then
  5319. connect mode is exited or a break is sent, as specified.  When output
  5320. characters are queued, connect status (accessed by '<escape>S') will
  5321. indicate the number of queued output characters.
  5322.  
  5323. @section(C-Kermit under OS-9)
  5324.  
  5325. C-Kermit was adapted to OS-9 by Christian Hemsing, RWTH, Aachen, Germany,
  5326. and Bob Larson of the University of Southern California.  This section of
  5327. the manual was written by Christian Hemsing.
  5328.  
  5329. The commands and operation of OS-9 C-Kermit should be identical to those of
  5330. UNIX C-Kermit, with the exceptions noted here and in the "beware file".
  5331.  
  5332. The initialization file is @q<.kermrc>.
  5333.  
  5334. @subsection<OS-9/68K Background>
  5335.  
  5336. OS-9/68k is a multiuser, multitasking operating system designed to run on
  5337. all Motorola 680x0 family processors from Microware Systems Corporation, 1900
  5338. N.W. 114th Street, Des Moines, Iowa 50332 (Trademarks: Microware, OS-9,
  5339. OS-9/68000, OS-9000).
  5340.  
  5341. Due to its modular design, most of the code is completely hardware
  5342. independent, so it can be easily be ported to a different hardware by writing
  5343. new device drivers.
  5344.  
  5345. The original (1980) OS-9/6809 was designed for the Motorola 6809 processor.
  5346. Later (1983) they switched to the 680x0 family and released OS-9/68000.  For
  5347. speed and compactness reasons most of the OS-9/68000 kernel is written in
  5348. 680x0 assembler language.  Now there is a so-called OS-9000 by Microware.  Its
  5349. kernel is written in C and thus it is portable.  It is presently available for
  5350. 680x0 and Intel's 80386/486, and Microware plans to add further support for
  5351. RISC and CISC processors.  (C-Kermit has not yet been tested under OS-9000.)
  5352.  
  5353. The 100% ROM-able, fast, compact code in conjunction with real-time
  5354. capabilities make OS-9/68k ideal for ROM-based systems used in measuring,
  5355. controlling, etc.  It has found a wide acceptance within the scientific and
  5356. industrial world.
  5357.  
  5358. Yet, a full disk based OS-9/68k offers a program development environment
  5359. similar to UNIX. This includes (of course, limited) UNIX sofware compatibility
  5360. at C source code level, source code level debugging, UNIX I/O model, UNIX task 
  5361. model, UNIX-like shell and networking.
  5362.  
  5363. A number of UNIX utilities like lex, yacc, lint, etc, have been ported to
  5364. OS-9/68k.
  5365.  
  5366. The basic commands of OS-9 are:
  5367. @begin<description,spread 0>
  5368. DEL@\delete a file
  5369.  
  5370. DELDIR@\delete a directory
  5371.  
  5372. MAKDIR@\create a directory
  5373.  
  5374. DIR@\directory listing
  5375.  
  5376. PROCS@\show currently running processes
  5377.  
  5378. LIST@\type contents of a text file
  5379.  
  5380. CHD@\change working directory
  5381.  
  5382. PD@\print working directory
  5383. @end<description>
  5384.  
  5385. All commands can be given a @q<"-?"> as a switch, which will display a brief
  5386. (usually sufficient) help message.
  5387.  
  5388. All command references (like all references to names on OS-9/68k) are NOT
  5389. case sensitive (switches, though, may be case sensitive since they are
  5390. interpreted by the running program).
  5391.  
  5392. @subsection<OS-9/68K Devices>
  5393.  
  5394. All devices (terminal lines, networks, disks) can have arbitrary names but
  5395. the usual convention is:
  5396.  
  5397. @ux<Terminal lines>:
  5398. @begin<format>
  5399. @tabclear()@tabset(1inch)
  5400.    @q<term>@\the console terminal
  5401.    @q<t1>@\terminal line #1
  5402.    @q<:>
  5403.    @q<t>@i<n>@\terminal line #@i<n>
  5404. @end<format>
  5405.  
  5406. @ux<Hard disks>:
  5407. @begin<format>
  5408. @tabclear()@tabset(1inch)
  5409.    @q<h0>@\hard disk #0
  5410.    @q<h1>@\hard disk #1
  5411.    @q<:>
  5412.    @q<h>@i<n>@\harddisk #@i<n>
  5413. @end<format>
  5414.  
  5415. @ux<Floppy disks (diskettes)>:
  5416. @begin<format>
  5417. @tabclear()@tabset(1inch)
  5418.    @q<d0>@\floppy disk drive #0
  5419.    @q<d1>@\floppy disk drive #1
  5420.    @q<:>
  5421.    @q<d>@i<n>@\floppy disk drive #@i<n>
  5422. @end<format>
  5423.  
  5424. A path name starting with a slash ("/") must always include a device name
  5425. as the first field.  For example, the C-Kermit command SET LINE /T3 would
  5426. select the terminal line @q</t3>.
  5427.  
  5428. The console terminal is either a real terminal, or the screen and keyboard of
  5429. a workstation such as a Macintosh, Amiga, or Atari ST that is running OS-9.
  5430. Terminal emulation is not done by OS-9 C-Kermit, but rather by the real
  5431. terminal or the workstation console driver.  This includes the capability to
  5432. display national and international characters.
  5433.  
  5434. @subsection<The OS-9/68K File System>
  5435.  
  5436. The file system is tree-structured just like the UNIX file system.
  5437. @example</h0/chris>
  5438. means the directory  or file "chris" on hard disk #0.
  5439. @example<chris/rubbish>
  5440. means the subdirectory or file "rubbish" in the subdirectory "chris" of the
  5441. current directory.
  5442.  
  5443. The command "chd" without any parameters will always take you to your home
  5444. directory.
  5445.  
  5446. Names of files, directories, devices, and commands are case-independent.
  5447. Filenames may contain letters, digits, period, underline, and dollar sign.
  5448. They are stored with upper and lower case preserved, but case is not
  5449. significant when referring to them.
  5450.  
  5451.  
  5452. Wildcard expansion is performed by the shell with two metacharacters:
  5453. @begin<description,leftmargin +4,indent -2>
  5454. @q<*>@\stands for an arbitrary string of arbitrary length
  5455. @q<?>@\denotes a single character
  5456. @end<description>
  5457.  
  5458. C-Kermit/OS-9 also expands wildcards itself, using the same notation, for
  5459. example:
  5460. @begin(example)
  5461. C-Kermit>send ck*.\?
  5462. @end(example)
  5463. (Note: the question mark must be prefixed by "\" to override its normal
  5464. function of giving a help message.)
  5465.  
  5466. OS-9/68k files are sequential streams of 8-bit bytes, just like in UNIX,
  5467. except that carriage return (CR, ASCII 13) is the line terminator, rather than
  5468. linefeed (LF, ASCII 10).  Binary files are simply streams of arbitrary 8-bit
  5469. bytes.  The OS-9 operating system and utilities are "8-bit clean", so text
  5470. files can use any ASCII-based character set that is compatible with your
  5471. display and data entry devices, for example ISO 8859-1 Latin Alphabet 1.
  5472.  
  5473. Unlike UNIX, OS-9/68k has a built-in method to gain exclusive access to
  5474. devices, so no lock files are needed.  The user will be told if the device is
  5475. already in use.
  5476.  
  5477. @subsection<To Build C-Kermit for OS-9>
  5478.  
  5479. Collect all the C-Kermit source files into a directory:
  5480. @example<ckc*.c, ckc*.h, cku*.c, cku*.h, ckwart.c, ckcpro.w, ck9*.*>
  5481.  
  5482. There are two makefiles: @q<ck9ker.mak> and @q<ck9ker.gcc>.  If you have a
  5483. running version of the GNU C compiler, use @q<ck9ker.gcc> (it produces smaller,
  5484. more efficient code); otherwise use @q<ck9ker.mak> which uses the standard
  5485. OS-9/68k C compiler.  Read the appropropriate makefile, edit the necessary
  5486. changes mentioned there, create the subdirectories, and make the new Kermit by
  5487. typing:
  5488. @example(make -f=ck9ker.mak)
  5489. or:
  5490. @example(make -f=ck9ker.gcc)
  5491.  
  5492. Read the "beware file" @q<ck9ker.bwr> for hints relating to the OS-9 terminal
  5493. driver.
  5494.